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 _0x2b6f=['extname','now','file','/:id','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','diskStorage','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename'];(function(_0x222b3f,_0x133be7){var _0x20b57a=function(_0x408ec3){while(--_0x408ec3){_0x222b3f['push'](_0x222b3f['shift']());}};_0x20b57a(++_0x133be7);}(_0x2b6f,0x1e2));var _0xf2b6=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x2b6f[_0x2aea9e];return _0x430b92;};'use strict';var multer=require(_0xf2b6('0x0'));var util=require(_0xf2b6('0x1'));var path=require(_0xf2b6('0x2'));var timeout=require(_0xf2b6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf2b6('0x4'));var auth=require(_0xf2b6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf2b6('0x6'));var controller=require('./sound.controller');router[_0xf2b6('0x7')]('/',auth[_0xf2b6('0x8')](),controller[_0xf2b6('0x9')]);router[_0xf2b6('0x7')]('/:id',auth[_0xf2b6('0x8')](),controller[_0xf2b6('0xa')]);router['get']('/:id/download',auth[_0xf2b6('0x8')](),controller['download']);var upload=multer({'storage':multer[_0xf2b6('0xb')]({'destination':function(_0x18581e,_0x5e15f6,_0x46397b){_0x46397b(null,path['join'](config['root'],_0xf2b6('0xc')));},'filename':function(_0x13ca23,_0x2b572a,_0x469737){_0x2b572a[_0xf2b6('0xd')]=_0x2b572a[_0xf2b6('0xd')][_0xf2b6('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x469737(null,util[_0xf2b6('0xf')](_0xf2b6('0x10'),path[_0xf2b6('0x11')](_0x2b572a[_0xf2b6('0xd')],path[_0xf2b6('0x12')](_0x2b572a[_0xf2b6('0xd')])),Date[_0xf2b6('0x13')](),path[_0xf2b6('0x12')](_0x2b572a[_0xf2b6('0xd')])));}})});router['post']('/',upload['single'](_0xf2b6('0x14')),controller['create']);router['put'](_0xf2b6('0x15'),auth[_0xf2b6('0x8')](),controller[_0xf2b6('0x16')]);router['delete'](_0xf2b6('0x15'),auth[_0xf2b6('0x8')](),controller[_0xf2b6('0x17')]);module[_0xf2b6('0x18')]=router;