5d1a8e3b76fbcc66dc9fc580079fb86e10d1aab0
[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 _0xdd7f=['delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','/:id','isAuthenticated','show','/:id/download','diskStorage','join','server/files/sounds/original/','originalname','replace','extname','now','post','single','file','create','put','update'];(function(_0x36a02f,_0x345209){var _0x3f6093=function(_0x55b37d){while(--_0x55b37d){_0x36a02f['push'](_0x36a02f['shift']());}};_0x3f6093(++_0x345209);}(_0xdd7f,0x124));var _0xfdd7=function(_0x3c055c,_0x45cdb5){_0x3c055c=_0x3c055c-0x0;var _0xd8fd8c=_0xdd7f[_0x3c055c];return _0xd8fd8c;};'use strict';var multer=require(_0xfdd7('0x0'));var util=require('util');var path=require(_0xfdd7('0x1'));var timeout=require(_0xfdd7('0x2'));var express=require(_0xfdd7('0x3'));var router=express[_0xfdd7('0x4')]();var fs_extra=require(_0xfdd7('0x5'));var auth=require(_0xfdd7('0x6'));var interaction=require(_0xfdd7('0x7'));var config=require(_0xfdd7('0x8'));var controller=require(_0xfdd7('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xfdd7('0xa'),auth[_0xfdd7('0xb')](),controller[_0xfdd7('0xc')]);router['get'](_0xfdd7('0xd'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0xfdd7('0xe')]({'destination':function(_0x8279e4,_0x4820e6,_0x3042c5){_0x3042c5(null,path[_0xfdd7('0xf')](config['root'],_0xfdd7('0x10')));},'filename':function(_0x524805,_0x2465ac,_0x555db0){_0x2465ac[_0xfdd7('0x11')]=_0x2465ac[_0xfdd7('0x11')][_0xfdd7('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x555db0(null,util['format']('%s-%s%s',path['basename'](_0x2465ac['originalname'],path[_0xfdd7('0x13')](_0x2465ac[_0xfdd7('0x11')])),Date[_0xfdd7('0x14')](),path[_0xfdd7('0x13')](_0x2465ac['originalname'])));}})});router[_0xfdd7('0x15')]('/',upload[_0xfdd7('0x16')](_0xfdd7('0x17')),controller[_0xfdd7('0x18')]);router[_0xfdd7('0x19')]('/:id',auth[_0xfdd7('0xb')](),controller[_0xfdd7('0x1a')]);router[_0xfdd7('0x1b')](_0xfdd7('0xa'),auth[_0xfdd7('0xb')](),controller[_0xfdd7('0x1b')]);module[_0xfdd7('0x1c')]=router;