Built motion from commit 44377920.|2.6.11
[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 _0xab8c=['isAuthenticated','index','show','download','join','root','originalname','format','%s-%s%s','basename','extname','single','create','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xab8c,0x18b));var _0xcab8=function(_0x571714,_0x30d2b3){_0x571714=_0x571714-0x0;var _0x599a14=_0xab8c[_0x571714];return _0x599a14;};'use strict';var multer=require(_0xcab8('0x0'));var util=require('util');var path=require(_0xcab8('0x1'));var timeout=require(_0xcab8('0x2'));var express=require(_0xcab8('0x3'));var router=express[_0xcab8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcab8('0x5'));var interaction=require(_0xcab8('0x6'));var config=require(_0xcab8('0x7'));var controller=require(_0xcab8('0x8'));router[_0xcab8('0x9')]('/',auth[_0xcab8('0xa')](),controller[_0xcab8('0xb')]);router['get']('/:id',auth[_0xcab8('0xa')](),controller[_0xcab8('0xc')]);router[_0xcab8('0x9')]('/:id/download',auth[_0xcab8('0xa')](),controller[_0xcab8('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4cab3a,_0xc6ed10,_0x1b0665){_0x1b0665(null,path[_0xcab8('0xe')](config[_0xcab8('0xf')],'server/files/sounds/original/'));},'filename':function(_0x4ce19d,_0x15ec1f,_0x33e458){_0x15ec1f[_0xcab8('0x10')]=_0x15ec1f[_0xcab8('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x33e458(null,util[_0xcab8('0x11')](_0xcab8('0x12'),path[_0xcab8('0x13')](_0x15ec1f[_0xcab8('0x10')],path[_0xcab8('0x14')](_0x15ec1f[_0xcab8('0x10')])),Date['now'](),path['extname'](_0x15ec1f[_0xcab8('0x10')])));}})});router['post']('/',upload[_0xcab8('0x15')]('file'),controller[_0xcab8('0x16')]);router['put'](_0xcab8('0x17'),auth['isAuthenticated'](),controller[_0xcab8('0x18')]);router[_0xcab8('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xcab8('0x19')]);module[_0xcab8('0x1a')]=router;