Built motion from commit (unavailable).|2.0.77
[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 _0x2f23=['show','/:id/download','download','diskStorage','originalname','replace','format','%s-%s%s','extname','now','post','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./sound.controller','/:id','isAuthenticated'];(function(_0x599da4,_0x2ec53d){var _0x380805=function(_0x15d390){while(--_0x15d390){_0x599da4['push'](_0x599da4['shift']());}};_0x380805(++_0x2ec53d);}(_0x2f23,0xd5));var _0x32f2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2f23[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x32f2('0x0'));var util=require(_0x32f2('0x1'));var path=require(_0x32f2('0x2'));var timeout=require(_0x32f2('0x3'));var express=require(_0x32f2('0x4'));var router=express[_0x32f2('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32f2('0x6'));var config=require(_0x32f2('0x7'));var controller=require(_0x32f2('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x32f2('0x9'),auth[_0x32f2('0xa')](),controller[_0x32f2('0xb')]);router['get'](_0x32f2('0xc'),auth[_0x32f2('0xa')](),controller[_0x32f2('0xd')]);var upload=multer({'storage':multer[_0x32f2('0xe')]({'destination':function(_0x1afe29,_0x364660,_0x153d3f){_0x153d3f(null,path['join'](config['root'],'server/files/sounds/original/'));},'filename':function(_0xb3d6ff,_0x2118b0,_0x2b4536){_0x2118b0[_0x32f2('0xf')]=_0x2118b0[_0x32f2('0xf')][_0x32f2('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2b4536(null,util[_0x32f2('0x11')](_0x32f2('0x12'),path['basename'](_0x2118b0[_0x32f2('0xf')],path[_0x32f2('0x13')](_0x2118b0[_0x32f2('0xf')])),Date[_0x32f2('0x14')](),path[_0x32f2('0x13')](_0x2118b0['originalname'])));}})});router[_0x32f2('0x15')]('/',upload['single'](_0x32f2('0x16')),controller[_0x32f2('0x17')]);router[_0x32f2('0x18')](_0x32f2('0x9'),auth[_0x32f2('0xa')](),controller[_0x32f2('0x19')]);router[_0x32f2('0x1a')]('/:id',auth[_0x32f2('0xa')](),controller[_0x32f2('0x1a')]);module[_0x32f2('0x1b')]=router;