Built motion from commit (unavailable).|2.5.21
[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 _0x800b=['basename','extname','post','single','file','create','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s'];(function(_0xb98d8d,_0x481423){var _0x489b15=function(_0x409a13){while(--_0x409a13){_0xb98d8d['push'](_0xb98d8d['shift']());}};_0x489b15(++_0x481423);}(_0x800b,0xf0));var _0xb800=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x800b[_0x2aecb2];return _0x3ebb80;};'use strict';var multer=require(_0xb800('0x0'));var util=require(_0xb800('0x1'));var path=require(_0xb800('0x2'));var timeout=require(_0xb800('0x3'));var express=require(_0xb800('0x4'));var router=express['Router']();var auth=require(_0xb800('0x5'));var interaction=require(_0xb800('0x6'));var config=require(_0xb800('0x7'));var controller=require(_0xb800('0x8'));router[_0xb800('0x9')]('/',auth[_0xb800('0xa')](),controller[_0xb800('0xb')]);router[_0xb800('0x9')](_0xb800('0xc'),auth[_0xb800('0xa')](),controller[_0xb800('0xd')]);router[_0xb800('0x9')](_0xb800('0xe'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2afe90,_0x6827e4,_0x9f07f0){_0x9f07f0(null,path[_0xb800('0xf')](config[_0xb800('0x10')],_0xb800('0x11')));},'filename':function(_0x227823,_0x42e165,_0x48b4c3){_0x42e165[_0xb800('0x12')]=_0x42e165[_0xb800('0x12')][_0xb800('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x48b4c3(null,util['format'](_0xb800('0x14'),path[_0xb800('0x15')](_0x42e165[_0xb800('0x12')],path[_0xb800('0x16')](_0x42e165['originalname'])),Date['now'](),path[_0xb800('0x16')](_0x42e165[_0xb800('0x12')])));}})});router[_0xb800('0x17')]('/',upload[_0xb800('0x18')](_0xb800('0x19')),controller[_0xb800('0x1a')]);router['put']('/:id',auth[_0xb800('0xa')](),controller[_0xb800('0x1b')]);router[_0xb800('0x1c')](_0xb800('0xc'),auth[_0xb800('0xa')](),controller[_0xb800('0x1c')]);module['exports']=router;