Built motion from commit 1fa89557.|2.6.10
[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 _0xf2fe=['./sound.controller','isAuthenticated','index','get','/:id','/:id/download','download','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','extname','now','post','single','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2362b1,_0x24c980){var _0x39c231=function(_0xaa55ef){while(--_0xaa55ef){_0x2362b1['push'](_0x2362b1['shift']());}};_0x39c231(++_0x24c980);}(_0xf2fe,0xc3));var _0xef2f=function(_0x55d16d,_0x21ee1d){_0x55d16d=_0x55d16d-0x0;var _0x53c6b6=_0xf2fe[_0x55d16d];return _0x53c6b6;};'use strict';var multer=require(_0xef2f('0x0'));var util=require(_0xef2f('0x1'));var path=require('path');var timeout=require(_0xef2f('0x2'));var express=require(_0xef2f('0x3'));var router=express[_0xef2f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xef2f('0x5'));var interaction=require(_0xef2f('0x6'));var config=require(_0xef2f('0x7'));var controller=require(_0xef2f('0x8'));router['get']('/',auth[_0xef2f('0x9')](),controller[_0xef2f('0xa')]);router[_0xef2f('0xb')](_0xef2f('0xc'),auth[_0xef2f('0x9')](),controller['show']);router[_0xef2f('0xb')](_0xef2f('0xd'),auth[_0xef2f('0x9')](),controller[_0xef2f('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4afb28,_0x14e7fb,_0x46a474){_0x46a474(null,path[_0xef2f('0xf')](config[_0xef2f('0x10')],_0xef2f('0x11')));},'filename':function(_0x4e2d5c,_0x2c6e32,_0x2a38f8){_0x2c6e32[_0xef2f('0x12')]=_0x2c6e32[_0xef2f('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2a38f8(null,util[_0xef2f('0x13')](_0xef2f('0x14'),path['basename'](_0x2c6e32[_0xef2f('0x12')],path[_0xef2f('0x15')](_0x2c6e32[_0xef2f('0x12')])),Date[_0xef2f('0x16')](),path[_0xef2f('0x15')](_0x2c6e32['originalname'])));}})});router[_0xef2f('0x17')]('/',upload[_0xef2f('0x18')]('file'),controller['create']);router[_0xef2f('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xef2f('0x1a')]);router[_0xef2f('0x1b')]('/:id',auth[_0xef2f('0x9')](),controller[_0xef2f('0x1b')]);module[_0xef2f('0x1c')]=router;