Built motion from commit (unavailable).|2.5.6
[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 _0xbd73=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/download','download','diskStorage','join','root','originalname','format','%s-%s%s','basename','extname','now'];(function(_0x1bead8,_0x38af3e){var _0x5192b4=function(_0x44a478){while(--_0x44a478){_0x1bead8['push'](_0x1bead8['shift']());}};_0x5192b4(++_0x38af3e);}(_0xbd73,0xba));var _0x3bd7=function(_0x4d2eea,_0x4727c4){_0x4d2eea=_0x4d2eea-0x0;var _0x194692=_0xbd73[_0x4d2eea];return _0x194692;};'use strict';var multer=require(_0x3bd7('0x0'));var util=require(_0x3bd7('0x1'));var path=require(_0x3bd7('0x2'));var timeout=require(_0x3bd7('0x3'));var express=require(_0x3bd7('0x4'));var router=express[_0x3bd7('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x3bd7('0x6'));var config=require(_0x3bd7('0x7'));var controller=require('./sound.controller');router['get']('/',auth[_0x3bd7('0x8')](),controller[_0x3bd7('0x9')]);router[_0x3bd7('0xa')](_0x3bd7('0xb'),auth[_0x3bd7('0x8')](),controller[_0x3bd7('0xc')]);router[_0x3bd7('0xa')](_0x3bd7('0xd'),auth[_0x3bd7('0x8')](),controller[_0x3bd7('0xe')]);var upload=multer({'storage':multer[_0x3bd7('0xf')]({'destination':function(_0x3f5fbc,_0x31ae54,_0xfabc9e){_0xfabc9e(null,path[_0x3bd7('0x10')](config[_0x3bd7('0x11')],'server/files/sounds/original/'));},'filename':function(_0x59c850,_0x4f3f98,_0x3317b0){_0x4f3f98[_0x3bd7('0x12')]=_0x4f3f98[_0x3bd7('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3317b0(null,util[_0x3bd7('0x13')](_0x3bd7('0x14'),path[_0x3bd7('0x15')](_0x4f3f98[_0x3bd7('0x12')],path[_0x3bd7('0x16')](_0x4f3f98['originalname'])),Date[_0x3bd7('0x17')](),path['extname'](_0x4f3f98[_0x3bd7('0x12')])));}})});router[_0x3bd7('0x18')]('/',upload['single']('file'),controller[_0x3bd7('0x19')]);router[_0x3bd7('0x1a')](_0x3bd7('0xb'),auth[_0x3bd7('0x8')](),controller[_0x3bd7('0x1b')]);router[_0x3bd7('0x1c')](_0x3bd7('0xb'),auth['isAuthenticated'](),controller[_0x3bd7('0x1c')]);module[_0x3bd7('0x1d')]=router;