3c69880dc1de5b2a9666ca23b63343b71d0dcdd8
[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 _0x2297=['root','server/files/sounds/original/','format','%s-%s%s','basename','originalname','now','extname','post','single','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','/:id','/:id/download','download','diskStorage','join'];(function(_0x24f988,_0x42b225){var _0x5c60b8=function(_0xc1e5f4){while(--_0xc1e5f4){_0x24f988['push'](_0x24f988['shift']());}};_0x5c60b8(++_0x42b225);}(_0x2297,0xa4));var _0x7229=function(_0x593125,_0x3d46f5){_0x593125=_0x593125-0x0;var _0x4ccc84=_0x2297[_0x593125];return _0x4ccc84;};'use strict';var multer=require(_0x7229('0x0'));var util=require(_0x7229('0x1'));var path=require(_0x7229('0x2'));var timeout=require(_0x7229('0x3'));var express=require('express');var router=express[_0x7229('0x4')]();var fs_extra=require(_0x7229('0x5'));var auth=require(_0x7229('0x6'));var interaction=require(_0x7229('0x7'));var config=require('../../config/environment');var controller=require(_0x7229('0x8'));router[_0x7229('0x9')]('/',auth[_0x7229('0xa')](),controller['index']);router[_0x7229('0x9')](_0x7229('0xb'),auth[_0x7229('0xa')](),controller['show']);router[_0x7229('0x9')](_0x7229('0xc'),auth[_0x7229('0xa')](),controller[_0x7229('0xd')]);var upload=multer({'storage':multer[_0x7229('0xe')]({'destination':function(_0x40676e,_0x3d7bc1,_0x2d5638){_0x2d5638(null,path[_0x7229('0xf')](config[_0x7229('0x10')],_0x7229('0x11')));},'filename':function(_0x56ab1f,_0x5c5358,_0x17d905){_0x5c5358['originalname']=_0x5c5358['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x17d905(null,util[_0x7229('0x12')](_0x7229('0x13'),path[_0x7229('0x14')](_0x5c5358[_0x7229('0x15')],path['extname'](_0x5c5358[_0x7229('0x15')])),Date[_0x7229('0x16')](),path[_0x7229('0x17')](_0x5c5358[_0x7229('0x15')])));}})});router[_0x7229('0x18')]('/',upload[_0x7229('0x19')]('file'),controller['create']);router[_0x7229('0x1a')](_0x7229('0xb'),auth['isAuthenticated'](),controller[_0x7229('0x1b')]);router[_0x7229('0x1c')]('/:id',auth[_0x7229('0xa')](),controller[_0x7229('0x1c')]);module[_0x7229('0x1d')]=router;