Built motion from commit d5e4af8c.|2.6.23
[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 _0xe67f=['../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','root','originalname','replace','format','%s-%s%s','now','extname','post','file','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2f1880,_0x3997df){var _0x5374b1=function(_0x4daf28){while(--_0x4daf28){_0x2f1880['push'](_0x2f1880['shift']());}};_0x5374b1(++_0x3997df);}(_0xe67f,0x1de));var _0xfe67=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe67f[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xfe67('0x0'));var util=require(_0xfe67('0x1'));var path=require(_0xfe67('0x2'));var timeout=require('connect-timeout');var express=require(_0xfe67('0x3'));var router=express[_0xfe67('0x4')]();var fs_extra=require(_0xfe67('0x5'));var auth=require(_0xfe67('0x6'));var interaction=require(_0xfe67('0x7'));var config=require(_0xfe67('0x8'));var controller=require(_0xfe67('0x9'));router[_0xfe67('0xa')]('/',auth[_0xfe67('0xb')](),controller['index']);router[_0xfe67('0xa')](_0xfe67('0xc'),auth[_0xfe67('0xb')](),controller[_0xfe67('0xd')]);router['get'](_0xfe67('0xe'),auth[_0xfe67('0xb')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x93e461,_0x52cc38,_0x5b4ba3){_0x5b4ba3(null,path['join'](config[_0xfe67('0xf')],'server/files/sounds/original/'));},'filename':function(_0x2eb325,_0x3ca085,_0x3b79c0){_0x3ca085[_0xfe67('0x10')]=_0x3ca085[_0xfe67('0x10')][_0xfe67('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3b79c0(null,util[_0xfe67('0x12')](_0xfe67('0x13'),path['basename'](_0x3ca085[_0xfe67('0x10')],path['extname'](_0x3ca085[_0xfe67('0x10')])),Date[_0xfe67('0x14')](),path[_0xfe67('0x15')](_0x3ca085[_0xfe67('0x10')])));}})});router[_0xfe67('0x16')]('/',upload['single'](_0xfe67('0x17')),controller['create']);router[_0xfe67('0x18')](_0xfe67('0xc'),auth[_0xfe67('0xb')](),controller[_0xfe67('0x19')]);router[_0xfe67('0x1a')](_0xfe67('0xc'),auth[_0xfe67('0xb')](),controller[_0xfe67('0x1a')]);module['exports']=router;