Built motion from commit b9b02fed.|2.6.5
[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 _0x2574=['/:id','/:id/download','download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','post','file','create','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index'];(function(_0x54717d,_0x45310a){var _0x5c97e6=function(_0x362e05){while(--_0x362e05){_0x54717d['push'](_0x54717d['shift']());}};_0x5c97e6(++_0x45310a);}(_0x2574,0x1d3));var _0x4257=function(_0x142132,_0x321cfc){_0x142132=_0x142132-0x0;var _0x3d70c4=_0x2574[_0x142132];return _0x3d70c4;};'use strict';var multer=require('multer');var util=require(_0x4257('0x0'));var path=require(_0x4257('0x1'));var timeout=require('connect-timeout');var express=require(_0x4257('0x2'));var router=express[_0x4257('0x3')]();var fs_extra=require(_0x4257('0x4'));var auth=require(_0x4257('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x4257('0x6')]('/',auth[_0x4257('0x7')](),controller[_0x4257('0x8')]);router['get'](_0x4257('0x9'),auth[_0x4257('0x7')](),controller['show']);router['get'](_0x4257('0xa'),auth[_0x4257('0x7')](),controller[_0x4257('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4a9be0,_0x236cba,_0x269f2d){_0x269f2d(null,path[_0x4257('0xc')](config[_0x4257('0xd')],_0x4257('0xe')));},'filename':function(_0x22d75d,_0x5db336,_0x317f0e){_0x5db336[_0x4257('0xf')]=_0x5db336['originalname'][_0x4257('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x317f0e(null,util[_0x4257('0x11')](_0x4257('0x12'),path['basename'](_0x5db336['originalname'],path[_0x4257('0x13')](_0x5db336[_0x4257('0xf')])),Date[_0x4257('0x14')](),path[_0x4257('0x13')](_0x5db336[_0x4257('0xf')])));}})});router[_0x4257('0x15')]('/',upload['single'](_0x4257('0x16')),controller[_0x4257('0x17')]);router[_0x4257('0x18')]('/:id',auth[_0x4257('0x7')](),controller[_0x4257('0x19')]);router[_0x4257('0x1a')](_0x4257('0x9'),auth[_0x4257('0x7')](),controller[_0x4257('0x1a')]);module[_0x4257('0x1b')]=router;