fe22b2a7769b3c7ba3682784fec36dea4afd45ab
[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 _0x657f=['/:id','/:id/download','download','join','root','originalname','replace','format','basename','extname','now','post','single','create','put','update','delete','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index'];(function(_0x31e716,_0x1a901f){var _0x531e97=function(_0x1b00ae){while(--_0x1b00ae){_0x31e716['push'](_0x31e716['shift']());}};_0x531e97(++_0x1a901f);}(_0x657f,0x146));var _0xf657=function(_0x2d5934,_0x1acc4f){_0x2d5934=_0x2d5934-0x0;var _0x5807c8=_0x657f[_0x2d5934];return _0x5807c8;};'use strict';var multer=require('multer');var util=require(_0xf657('0x0'));var path=require(_0xf657('0x1'));var timeout=require(_0xf657('0x2'));var express=require('express');var router=express[_0xf657('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf657('0x4'));var config=require(_0xf657('0x5'));var controller=require(_0xf657('0x6'));router[_0xf657('0x7')]('/',auth[_0xf657('0x8')](),controller[_0xf657('0x9')]);router[_0xf657('0x7')](_0xf657('0xa'),auth[_0xf657('0x8')](),controller['show']);router[_0xf657('0x7')](_0xf657('0xb'),auth['isAuthenticated'](),controller[_0xf657('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5ea606,_0x14f588,_0x385835){_0x385835(null,path[_0xf657('0xd')](config[_0xf657('0xe')],'server/files/sounds/original/'));},'filename':function(_0x56674a,_0x34e6ee,_0x65960b){_0x34e6ee[_0xf657('0xf')]=_0x34e6ee[_0xf657('0xf')][_0xf657('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x65960b(null,util[_0xf657('0x11')]('%s-%s%s',path[_0xf657('0x12')](_0x34e6ee[_0xf657('0xf')],path[_0xf657('0x13')](_0x34e6ee[_0xf657('0xf')])),Date[_0xf657('0x14')](),path['extname'](_0x34e6ee[_0xf657('0xf')])));}})});router[_0xf657('0x15')]('/',upload[_0xf657('0x16')]('file'),controller[_0xf657('0x17')]);router[_0xf657('0x18')](_0xf657('0xa'),auth['isAuthenticated'](),controller[_0xf657('0x19')]);router[_0xf657('0x1a')](_0xf657('0xa'),auth[_0xf657('0x8')](),controller[_0xf657('0x1a')]);module[_0xf657('0x1b')]=router;