b5d4a381044ee271d87fac5edc8fc7a6bf5322ee
[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 _0x32a8=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','post','single','file','create','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x3bb15f,_0x3e4cb4){var _0x26050a=function(_0x7432be){while(--_0x7432be){_0x3bb15f['push'](_0x3bb15f['shift']());}};_0x26050a(++_0x3e4cb4);}(_0x32a8,0x17d));var _0x832a=function(_0x12ac1f,_0x461a52){_0x12ac1f=_0x12ac1f-0x0;var _0x724467=_0x32a8[_0x12ac1f];return _0x724467;};'use strict';var multer=require(_0x832a('0x0'));var util=require(_0x832a('0x1'));var path=require(_0x832a('0x2'));var timeout=require(_0x832a('0x3'));var express=require(_0x832a('0x4'));var router=express[_0x832a('0x5')]();var fs_extra=require(_0x832a('0x6'));var auth=require(_0x832a('0x7'));var interaction=require(_0x832a('0x8'));var config=require(_0x832a('0x9'));var controller=require(_0x832a('0xa'));router[_0x832a('0xb')]('/',auth[_0x832a('0xc')](),controller[_0x832a('0xd')]);router['get'](_0x832a('0xe'),auth[_0x832a('0xc')](),controller[_0x832a('0xf')]);router[_0x832a('0xb')](_0x832a('0x10'),auth[_0x832a('0xc')](),controller[_0x832a('0x11')]);var upload=multer({'storage':multer[_0x832a('0x12')]({'destination':function(_0x3d5b6d,_0xf43205,_0x10b586){_0x10b586(null,path[_0x832a('0x13')](config[_0x832a('0x14')],_0x832a('0x15')));},'filename':function(_0x444351,_0x472e04,_0x30f6e3){_0x472e04[_0x832a('0x16')]=_0x472e04[_0x832a('0x16')][_0x832a('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x30f6e3(null,util[_0x832a('0x18')]('%s-%s%s',path[_0x832a('0x19')](_0x472e04['originalname'],path[_0x832a('0x1a')](_0x472e04['originalname'])),Date[_0x832a('0x1b')](),path[_0x832a('0x1a')](_0x472e04[_0x832a('0x16')])));}})});router[_0x832a('0x1c')]('/',upload[_0x832a('0x1d')](_0x832a('0x1e')),controller[_0x832a('0x1f')]);router[_0x832a('0x20')](_0x832a('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x832a('0xe'),auth[_0x832a('0xc')](),controller[_0x832a('0x21')]);module[_0x832a('0x22')]=router;