Built motion from commit (unavailable).|2.5.23
[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 _0x9a95=['basename','now','extname','post','single','file','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','/:id','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format'];(function(_0x58fb70,_0x43d506){var _0x1223fc=function(_0x5e9a8e){while(--_0x5e9a8e){_0x58fb70['push'](_0x58fb70['shift']());}};_0x1223fc(++_0x43d506);}(_0x9a95,0x16a));var _0x59a9=function(_0x300251,_0x2c83ee){_0x300251=_0x300251-0x0;var _0x56f027=_0x9a95[_0x300251];return _0x56f027;};'use strict';var multer=require(_0x59a9('0x0'));var util=require(_0x59a9('0x1'));var path=require(_0x59a9('0x2'));var timeout=require(_0x59a9('0x3'));var express=require(_0x59a9('0x4'));var router=express[_0x59a9('0x5')]();var auth=require(_0x59a9('0x6'));var interaction=require(_0x59a9('0x7'));var config=require('../../config/environment');var controller=require(_0x59a9('0x8'));router[_0x59a9('0x9')]('/',auth[_0x59a9('0xa')](),controller[_0x59a9('0xb')]);router[_0x59a9('0x9')](_0x59a9('0xc'),auth[_0x59a9('0xa')](),controller[_0x59a9('0xd')]);router[_0x59a9('0x9')]('/:id/download',auth[_0x59a9('0xa')](),controller[_0x59a9('0xe')]);var upload=multer({'storage':multer[_0x59a9('0xf')]({'destination':function(_0xb37abf,_0x3e67c2,_0x210a1){_0x210a1(null,path[_0x59a9('0x10')](config[_0x59a9('0x11')],_0x59a9('0x12')));},'filename':function(_0x5e25ca,_0x3a1cc6,_0x587442){_0x3a1cc6[_0x59a9('0x13')]=_0x3a1cc6[_0x59a9('0x13')][_0x59a9('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x587442(null,util[_0x59a9('0x15')]('%s-%s%s',path[_0x59a9('0x16')](_0x3a1cc6[_0x59a9('0x13')],path['extname'](_0x3a1cc6[_0x59a9('0x13')])),Date[_0x59a9('0x17')](),path[_0x59a9('0x18')](_0x3a1cc6[_0x59a9('0x13')])));}})});router[_0x59a9('0x19')]('/',upload[_0x59a9('0x1a')](_0x59a9('0x1b')),controller[_0x59a9('0x1c')]);router['put'](_0x59a9('0xc'),auth['isAuthenticated'](),controller[_0x59a9('0x1d')]);router[_0x59a9('0x1e')](_0x59a9('0xc'),auth[_0x59a9('0xa')](),controller[_0x59a9('0x1e')]);module[_0x59a9('0x1f')]=router;