e6bd0649342fab692e5837e3cec79100002ca50a
[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 _0xff20=['server/files/sounds/original/','originalname','replace','%s-%s%s','post','file','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','/:id/download','download','diskStorage','join','root'];(function(_0x2bf850,_0x1082af){var _0x5bc9a4=function(_0x330b67){while(--_0x330b67){_0x2bf850['push'](_0x2bf850['shift']());}};_0x5bc9a4(++_0x1082af);}(_0xff20,0x9d));var _0x0ff2=function(_0x4b1c61,_0x33adfd){_0x4b1c61=_0x4b1c61-0x0;var _0x54a1ad=_0xff20[_0x4b1c61];return _0x54a1ad;};'use strict';var multer=require(_0x0ff2('0x0'));var util=require(_0x0ff2('0x1'));var path=require(_0x0ff2('0x2'));var timeout=require(_0x0ff2('0x3'));var express=require(_0x0ff2('0x4'));var router=express['Router']();var auth=require(_0x0ff2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0ff2('0x6'));var controller=require(_0x0ff2('0x7'));router[_0x0ff2('0x8')]('/',auth[_0x0ff2('0x9')](),controller[_0x0ff2('0xa')]);router['get']('/:id',auth[_0x0ff2('0x9')](),controller[_0x0ff2('0xb')]);router[_0x0ff2('0x8')](_0x0ff2('0xc'),auth['isAuthenticated'](),controller[_0x0ff2('0xd')]);var upload=multer({'storage':multer[_0x0ff2('0xe')]({'destination':function(_0x3463d2,_0x285997,_0x1bdb29){_0x1bdb29(null,path[_0x0ff2('0xf')](config[_0x0ff2('0x10')],_0x0ff2('0x11')));},'filename':function(_0x3f15ba,_0x11e832,_0x9f13b4){_0x11e832[_0x0ff2('0x12')]=_0x11e832[_0x0ff2('0x12')][_0x0ff2('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x9f13b4(null,util['format'](_0x0ff2('0x14'),path['basename'](_0x11e832[_0x0ff2('0x12')],path['extname'](_0x11e832[_0x0ff2('0x12')])),Date['now'](),path['extname'](_0x11e832[_0x0ff2('0x12')])));}})});router[_0x0ff2('0x15')]('/',upload['single'](_0x0ff2('0x16')),controller[_0x0ff2('0x17')]);router[_0x0ff2('0x18')]('/:id',auth[_0x0ff2('0x9')](),controller[_0x0ff2('0x19')]);router[_0x0ff2('0x1a')](_0x0ff2('0x1b'),auth[_0x0ff2('0x9')](),controller[_0x0ff2('0x1a')]);module[_0x0ff2('0x1c')]=router;