532072c891455bce4166f260295942f18f6de159
[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 _0x9f5f=['isAuthenticated','download','diskStorage','join','root','server/files/sounds/original/','originalname','basename','extname','now','post','single','file','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','index','show'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x9f5f,0x121));var _0xf9f5=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9f5f[_0x4a9fb1];return _0x348672;};'use strict';var multer=require('multer');var util=require(_0xf9f5('0x0'));var path=require(_0xf9f5('0x1'));var timeout=require(_0xf9f5('0x2'));var express=require(_0xf9f5('0x3'));var router=express[_0xf9f5('0x4')]();var auth=require(_0xf9f5('0x5'));var interaction=require(_0xf9f5('0x6'));var config=require('../../config/environment');var controller=require(_0xf9f5('0x7'));router[_0xf9f5('0x8')]('/',auth['isAuthenticated'](),controller[_0xf9f5('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf9f5('0xa')]);router[_0xf9f5('0x8')]('/:id/download',auth[_0xf9f5('0xb')](),controller[_0xf9f5('0xc')]);var upload=multer({'storage':multer[_0xf9f5('0xd')]({'destination':function(_0x318517,_0xebc2d1,_0x16eadb){_0x16eadb(null,path[_0xf9f5('0xe')](config[_0xf9f5('0xf')],_0xf9f5('0x10')));},'filename':function(_0x48230b,_0x5e029d,_0x35ba5f){_0x5e029d[_0xf9f5('0x11')]=_0x5e029d[_0xf9f5('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x35ba5f(null,util['format']('%s-%s%s',path[_0xf9f5('0x12')](_0x5e029d[_0xf9f5('0x11')],path[_0xf9f5('0x13')](_0x5e029d[_0xf9f5('0x11')])),Date[_0xf9f5('0x14')](),path[_0xf9f5('0x13')](_0x5e029d[_0xf9f5('0x11')])));}})});router[_0xf9f5('0x15')]('/',upload[_0xf9f5('0x16')](_0xf9f5('0x17')),controller[_0xf9f5('0x18')]);router[_0xf9f5('0x19')](_0xf9f5('0x1a'),auth[_0xf9f5('0xb')](),controller[_0xf9f5('0x1b')]);router[_0xf9f5('0x1c')]('/:id',auth[_0xf9f5('0xb')](),controller[_0xf9f5('0x1c')]);module[_0xf9f5('0x1d')]=router;