Built motion from commit e02f907f.|2.6.14
[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 _0x6569=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','isAuthenticated','get','show','download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','put','/:id','update','delete','exports','multer','util','path'];(function(_0x26b4e7,_0x20cffe){var _0x2e3484=function(_0x25f3e6){while(--_0x25f3e6){_0x26b4e7['push'](_0x26b4e7['shift']());}};_0x2e3484(++_0x20cffe);}(_0x6569,0xbd));var _0x9656=function(_0x4bbfef,_0x9d4cef){_0x4bbfef=_0x4bbfef-0x0;var _0x5a8120=_0x6569[_0x4bbfef];return _0x5a8120;};'use strict';var multer=require(_0x9656('0x0'));var util=require(_0x9656('0x1'));var path=require(_0x9656('0x2'));var timeout=require(_0x9656('0x3'));var express=require(_0x9656('0x4'));var router=express['Router']();var fs_extra=require(_0x9656('0x5'));var auth=require(_0x9656('0x6'));var interaction=require(_0x9656('0x7'));var config=require('../../config/environment');var controller=require(_0x9656('0x8'));router['get']('/',auth[_0x9656('0x9')](),controller['index']);router[_0x9656('0xa')]('/:id',auth[_0x9656('0x9')](),controller[_0x9656('0xb')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x9656('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x44bfb0,_0x556fd6,_0x296ac4){_0x296ac4(null,path[_0x9656('0xd')](config[_0x9656('0xe')],_0x9656('0xf')));},'filename':function(_0x92928b,_0x1a7327,_0x1b8772){_0x1a7327[_0x9656('0x10')]=_0x1a7327[_0x9656('0x10')][_0x9656('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1b8772(null,util[_0x9656('0x12')](_0x9656('0x13'),path[_0x9656('0x14')](_0x1a7327['originalname'],path[_0x9656('0x15')](_0x1a7327[_0x9656('0x10')])),Date[_0x9656('0x16')](),path['extname'](_0x1a7327['originalname'])));}})});router[_0x9656('0x17')]('/',upload[_0x9656('0x18')](_0x9656('0x19')),controller[_0x9656('0x1a')]);router[_0x9656('0x1b')](_0x9656('0x1c'),auth['isAuthenticated'](),controller[_0x9656('0x1d')]);router[_0x9656('0x1e')](_0x9656('0x1c'),auth[_0x9656('0x9')](),controller[_0x9656('0x1e')]);module[_0x9656('0x1f')]=router;