6337957339f3b21a63b54d156f22f543efd6be3e
[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 _0x419e=['join','root','server/files/sounds/original/','originalname','replace','basename','extname','now','post','file','create','put','update','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./sound.controller','get','isAuthenticated','show','/:id/download','download'];(function(_0x4ded65,_0xc8d7c1){var _0x5864fb=function(_0x40df9d){while(--_0x40df9d){_0x4ded65['push'](_0x4ded65['shift']());}};_0x5864fb(++_0xc8d7c1);}(_0x419e,0xf7));var _0xe419=function(_0xfa260b,_0xd2d0d){_0xfa260b=_0xfa260b-0x0;var _0x48fb84=_0x419e[_0xfa260b];return _0x48fb84;};'use strict';var multer=require(_0xe419('0x0'));var util=require(_0xe419('0x1'));var path=require(_0xe419('0x2'));var timeout=require(_0xe419('0x3'));var express=require(_0xe419('0x4'));var router=express[_0xe419('0x5')]();var fs_extra=require(_0xe419('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe419('0x7'));var config=require('../../config/environment');var controller=require(_0xe419('0x8'));router[_0xe419('0x9')]('/',auth[_0xe419('0xa')](),controller['index']);router[_0xe419('0x9')]('/:id',auth[_0xe419('0xa')](),controller[_0xe419('0xb')]);router['get'](_0xe419('0xc'),auth[_0xe419('0xa')](),controller[_0xe419('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x76c989,_0x4237ad,_0x2f9a9e){_0x2f9a9e(null,path[_0xe419('0xe')](config[_0xe419('0xf')],_0xe419('0x10')));},'filename':function(_0x28bb18,_0x3539f6,_0x2adc47){_0x3539f6[_0xe419('0x11')]=_0x3539f6[_0xe419('0x11')][_0xe419('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2adc47(null,util['format']('%s-%s%s',path[_0xe419('0x13')](_0x3539f6[_0xe419('0x11')],path[_0xe419('0x14')](_0x3539f6[_0xe419('0x11')])),Date[_0xe419('0x15')](),path['extname'](_0x3539f6[_0xe419('0x11')])));}})});router[_0xe419('0x16')]('/',upload['single'](_0xe419('0x17')),controller[_0xe419('0x18')]);router[_0xe419('0x19')]('/:id',auth[_0xe419('0xa')](),controller[_0xe419('0x1a')]);router['delete'](_0xe419('0x1b'),auth[_0xe419('0xa')](),controller['delete']);module[_0xe419('0x1c')]=router;