1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xfb48=['%s-%s%s','now','extname','single','file','put','/:id','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','/:id/download','download','diskStorage','join','root','originalname','replace','format'];(function(_0x3854d2,_0x5dc869){var _0x2a5e50=function(_0x3e7e44){while(--_0x3e7e44){_0x3854d2['push'](_0x3854d2['shift']());}};_0x2a5e50(++_0x5dc869);}(_0xfb48,0x117));var _0x8fb4=function(_0x93e539,_0x319cbd){_0x93e539=_0x93e539-0x0;var _0x299f43=_0xfb48[_0x93e539];return _0x299f43;};'use strict';var multer=require('multer');var util=require(_0x8fb4('0x0'));var path=require(_0x8fb4('0x1'));var timeout=require(_0x8fb4('0x2'));var express=require(_0x8fb4('0x3'));var router=express[_0x8fb4('0x4')]();var fs_extra=require(_0x8fb4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8fb4('0x6'));var config=require(_0x8fb4('0x7'));var controller=require(_0x8fb4('0x8'));router[_0x8fb4('0x9')]('/',auth[_0x8fb4('0xa')](),controller[_0x8fb4('0xb')]);router[_0x8fb4('0x9')]('/:id',auth[_0x8fb4('0xa')](),controller[_0x8fb4('0xc')]);router[_0x8fb4('0x9')](_0x8fb4('0xd'),auth[_0x8fb4('0xa')](),controller[_0x8fb4('0xe')]);var upload=multer({'storage':multer[_0x8fb4('0xf')]({'destination':function(_0x295a6f,_0x2fb1ca,_0x36c786){_0x36c786(null,path[_0x8fb4('0x10')](config[_0x8fb4('0x11')],'server/files/sounds/original/'));},'filename':function(_0x61af33,_0xa66f77,_0x5f5aa4){_0xa66f77[_0x8fb4('0x12')]=_0xa66f77[_0x8fb4('0x12')][_0x8fb4('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5f5aa4(null,util[_0x8fb4('0x14')](_0x8fb4('0x15'),path['basename'](_0xa66f77['originalname'],path['extname'](_0xa66f77[_0x8fb4('0x12')])),Date[_0x8fb4('0x16')](),path[_0x8fb4('0x17')](_0xa66f77[_0x8fb4('0x12')])));}})});router['post']('/',upload[_0x8fb4('0x18')](_0x8fb4('0x19')),controller['create']);router[_0x8fb4('0x1a')](_0x8fb4('0x1b'),auth[_0x8fb4('0xa')](),controller[_0x8fb4('0x1c')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8fb4('0x1d')]);module['exports']=router;