71710ec85bfd2fcce82192ccbdcc2f5cd6c24abe
[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 _0xf5fe=['%s-%s%s','basename','extname','now','post','single','file','create','update','delete','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','join','server/files/sounds/original/','originalname','replace','format'];(function(_0x4ae731,_0x2a4968){var _0x387501=function(_0x44d53b){while(--_0x44d53b){_0x4ae731['push'](_0x4ae731['shift']());}};_0x387501(++_0x2a4968);}(_0xf5fe,0x82));var _0xef5f=function(_0x5f4cbc,_0x28fad7){_0x5f4cbc=_0x5f4cbc-0x0;var _0x3c7140=_0xf5fe[_0x5f4cbc];return _0x3c7140;};'use strict';var multer=require(_0xef5f('0x0'));var util=require(_0xef5f('0x1'));var path=require('path');var timeout=require(_0xef5f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xef5f('0x3'));var auth=require(_0xef5f('0x4'));var interaction=require(_0xef5f('0x5'));var config=require(_0xef5f('0x6'));var controller=require(_0xef5f('0x7'));router['get']('/',auth[_0xef5f('0x8')](),controller[_0xef5f('0x9')]);router[_0xef5f('0xa')](_0xef5f('0xb'),auth['isAuthenticated'](),controller[_0xef5f('0xc')]);router['get'](_0xef5f('0xd'),auth['isAuthenticated'](),controller[_0xef5f('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2d5fa6,_0x4dc4e8,_0x3544f3){_0x3544f3(null,path[_0xef5f('0xf')](config['root'],_0xef5f('0x10')));},'filename':function(_0x175c5c,_0x5d4844,_0x48539a){_0x5d4844[_0xef5f('0x11')]=_0x5d4844['originalname'][_0xef5f('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x48539a(null,util[_0xef5f('0x13')](_0xef5f('0x14'),path[_0xef5f('0x15')](_0x5d4844[_0xef5f('0x11')],path[_0xef5f('0x16')](_0x5d4844['originalname'])),Date[_0xef5f('0x17')](),path[_0xef5f('0x16')](_0x5d4844[_0xef5f('0x11')])));}})});router[_0xef5f('0x18')]('/',upload[_0xef5f('0x19')](_0xef5f('0x1a')),controller[_0xef5f('0x1b')]);router['put']('/:id',auth[_0xef5f('0x8')](),controller[_0xef5f('0x1c')]);router[_0xef5f('0x1d')](_0xef5f('0xb'),auth['isAuthenticated'](),controller[_0xef5f('0x1d')]);module['exports']=router;