Built motion from commit bab6f49e.|2.6.17
[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 _0xbb1c=['extname','now','post','single','create','put','update','delete','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/download','diskStorage','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb1c,0x141));var _0xcbb1=function(_0x57cf13,_0xb84907){_0x57cf13=_0x57cf13-0x0;var _0xa6eb7=_0xbb1c[_0x57cf13];return _0xa6eb7;};'use strict';var multer=require('multer');var util=require(_0xcbb1('0x0'));var path=require('path');var timeout=require(_0xcbb1('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcbb1('0x2'));var auth=require(_0xcbb1('0x3'));var interaction=require(_0xcbb1('0x4'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0xcbb1('0x5')]('/',auth[_0xcbb1('0x6')](),controller['index']);router['get'](_0xcbb1('0x7'),auth[_0xcbb1('0x6')](),controller[_0xcbb1('0x8')]);router[_0xcbb1('0x5')](_0xcbb1('0x9'),auth[_0xcbb1('0x6')](),controller['download']);var upload=multer({'storage':multer[_0xcbb1('0xa')]({'destination':function(_0x3340c5,_0x3d3e0a,_0x1c1a83){_0x1c1a83(null,path['join'](config['root'],_0xcbb1('0xb')));},'filename':function(_0x388b97,_0x1264da,_0x263b0a){_0x1264da[_0xcbb1('0xc')]=_0x1264da[_0xcbb1('0xc')][_0xcbb1('0xd')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x263b0a(null,util[_0xcbb1('0xe')](_0xcbb1('0xf'),path[_0xcbb1('0x10')](_0x1264da[_0xcbb1('0xc')],path[_0xcbb1('0x11')](_0x1264da[_0xcbb1('0xc')])),Date[_0xcbb1('0x12')](),path[_0xcbb1('0x11')](_0x1264da['originalname'])));}})});router[_0xcbb1('0x13')]('/',upload[_0xcbb1('0x14')]('file'),controller[_0xcbb1('0x15')]);router[_0xcbb1('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xcbb1('0x17')]);router[_0xcbb1('0x18')](_0xcbb1('0x7'),auth['isAuthenticated'](),controller[_0xcbb1('0x18')]);module[_0xcbb1('0x19')]=router;