Built motion from commit (unavailable).|2.5.17
[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 _0x4eb4=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','/:id','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x5b8d83,_0x3f8b3d){var _0x107083=function(_0x5b76bf){while(--_0x5b76bf){_0x5b8d83['push'](_0x5b8d83['shift']());}};_0x107083(++_0x3f8b3d);}(_0x4eb4,0xa1));var _0x44eb=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0x4eb4[_0x54b396];return _0x532e6d;};'use strict';var multer=require(_0x44eb('0x0'));var util=require(_0x44eb('0x1'));var path=require(_0x44eb('0x2'));var timeout=require(_0x44eb('0x3'));var express=require(_0x44eb('0x4'));var router=express['Router']();var auth=require(_0x44eb('0x5'));var interaction=require(_0x44eb('0x6'));var config=require(_0x44eb('0x7'));var controller=require(_0x44eb('0x8'));router[_0x44eb('0x9')]('/',auth[_0x44eb('0xa')](),controller['index']);router[_0x44eb('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x44eb('0xb')]);router[_0x44eb('0x9')](_0x44eb('0xc'),auth[_0x44eb('0xa')](),controller[_0x44eb('0xd')]);var upload=multer({'storage':multer[_0x44eb('0xe')]({'destination':function(_0x4bd1d0,_0x323fdc,_0x326969){_0x326969(null,path[_0x44eb('0xf')](config[_0x44eb('0x10')],_0x44eb('0x11')));},'filename':function(_0x2c3b93,_0x4f34a6,_0x40634c){_0x4f34a6[_0x44eb('0x12')]=_0x4f34a6[_0x44eb('0x12')][_0x44eb('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x40634c(null,util[_0x44eb('0x14')](_0x44eb('0x15'),path[_0x44eb('0x16')](_0x4f34a6[_0x44eb('0x12')],path[_0x44eb('0x17')](_0x4f34a6[_0x44eb('0x12')])),Date[_0x44eb('0x18')](),path['extname'](_0x4f34a6['originalname'])));}})});router[_0x44eb('0x19')]('/',upload[_0x44eb('0x1a')](_0x44eb('0x1b')),controller[_0x44eb('0x1c')]);router['put'](_0x44eb('0x1d'),auth['isAuthenticated'](),controller[_0x44eb('0x1e')]);router[_0x44eb('0x1f')]('/:id',auth[_0x44eb('0xa')](),controller[_0x44eb('0x1f')]);module[_0x44eb('0x20')]=router;