Built motion from commit a61a4a20.|2.5.46
[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 _0xcc16=['download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','now','extname','post','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download'];(function(_0x37f50e,_0x13e43a){var _0x4af190=function(_0x5bbff8){while(--_0x5bbff8){_0x37f50e['push'](_0x37f50e['shift']());}};_0x4af190(++_0x13e43a);}(_0xcc16,0x1ee));var _0x6cc1=function(_0x3a2e4b,_0x1fc1f7){_0x3a2e4b=_0x3a2e4b-0x0;var _0x3697d9=_0xcc16[_0x3a2e4b];return _0x3697d9;};'use strict';var multer=require(_0x6cc1('0x0'));var util=require(_0x6cc1('0x1'));var path=require(_0x6cc1('0x2'));var timeout=require(_0x6cc1('0x3'));var express=require(_0x6cc1('0x4'));var router=express['Router']();var fs_extra=require(_0x6cc1('0x5'));var auth=require(_0x6cc1('0x6'));var interaction=require(_0x6cc1('0x7'));var config=require(_0x6cc1('0x8'));var controller=require(_0x6cc1('0x9'));router[_0x6cc1('0xa')]('/',auth['isAuthenticated'](),controller[_0x6cc1('0xb')]);router[_0x6cc1('0xa')](_0x6cc1('0xc'),auth[_0x6cc1('0xd')](),controller[_0x6cc1('0xe')]);router[_0x6cc1('0xa')](_0x6cc1('0xf'),auth[_0x6cc1('0xd')](),controller[_0x6cc1('0x10')]);var upload=multer({'storage':multer[_0x6cc1('0x11')]({'destination':function(_0x2d6ab4,_0x4f05ea,_0xe852bf){_0xe852bf(null,path[_0x6cc1('0x12')](config[_0x6cc1('0x13')],_0x6cc1('0x14')));},'filename':function(_0x12be22,_0x5a339b,_0x1667c2){_0x5a339b['originalname']=_0x5a339b[_0x6cc1('0x15')][_0x6cc1('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1667c2(null,util[_0x6cc1('0x17')](_0x6cc1('0x18'),path['basename'](_0x5a339b['originalname'],path['extname'](_0x5a339b[_0x6cc1('0x15')])),Date[_0x6cc1('0x19')](),path[_0x6cc1('0x1a')](_0x5a339b[_0x6cc1('0x15')])));}})});router[_0x6cc1('0x1b')]('/',upload['single'](_0x6cc1('0x1c')),controller[_0x6cc1('0x1d')]);router[_0x6cc1('0x1e')](_0x6cc1('0xc'),auth[_0x6cc1('0xd')](),controller[_0x6cc1('0x1f')]);router[_0x6cc1('0x20')](_0x6cc1('0xc'),auth['isAuthenticated'](),controller[_0x6cc1('0x20')]);module[_0x6cc1('0x21')]=router;