94a6ff1f69ae1660d7e6c0a07f7015a1000b1ab3
[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 _0xbaca=['download','root','server/files/sounds/original/','originalname','%s-%s%s','basename','extname','now','post','single','put','/:id','update','delete','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','show','/:id/download'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xbaca,0x77));var _0xabac=function(_0x1f1a97,_0xadfc15){_0x1f1a97=_0x1f1a97-0x0;var _0x29fc6a=_0xbaca[_0x1f1a97];return _0x29fc6a;};'use strict';var multer=require(_0xabac('0x0'));var util=require(_0xabac('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xabac('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xabac('0x3'));var interaction=require(_0xabac('0x4'));var config=require(_0xabac('0x5'));var controller=require(_0xabac('0x6'));router[_0xabac('0x7')]('/',auth[_0xabac('0x8')](),controller['index']);router['get']('/:id',auth[_0xabac('0x8')](),controller[_0xabac('0x9')]);router[_0xabac('0x7')](_0xabac('0xa'),auth[_0xabac('0x8')](),controller[_0xabac('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5ad283,_0x32fe5b,_0x32fafb){_0x32fafb(null,path['join'](config[_0xabac('0xc')],_0xabac('0xd')));},'filename':function(_0x5c5f26,_0x2c8c12,_0x530a08){_0x2c8c12['originalname']=_0x2c8c12[_0xabac('0xe')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x530a08(null,util['format'](_0xabac('0xf'),path[_0xabac('0x10')](_0x2c8c12['originalname'],path[_0xabac('0x11')](_0x2c8c12['originalname'])),Date[_0xabac('0x12')](),path[_0xabac('0x11')](_0x2c8c12[_0xabac('0xe')])));}})});router[_0xabac('0x13')]('/',upload[_0xabac('0x14')]('file'),controller['create']);router[_0xabac('0x15')](_0xabac('0x16'),auth[_0xabac('0x8')](),controller[_0xabac('0x17')]);router[_0xabac('0x18')]('/:id',auth[_0xabac('0x8')](),controller[_0xabac('0x18')]);module[_0xabac('0x19')]=router;