Built motion from commit (unavailable).|2.5.0
[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 _0x78f2=['/:id/download','download','diskStorage','join','originalname','replace','format','basename','now','post','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2718ee,_0x408952){var _0x18bb3b=function(_0x1b0e66){while(--_0x1b0e66){_0x2718ee['push'](_0x2718ee['shift']());}};_0x18bb3b(++_0x408952);}(_0x78f2,0x6e));var _0x278f=function(_0x4ebe70,_0xd366aa){_0x4ebe70=_0x4ebe70-0x0;var _0x5c4b8c=_0x78f2[_0x4ebe70];return _0x5c4b8c;};'use strict';var multer=require(_0x278f('0x0'));var util=require(_0x278f('0x1'));var path=require(_0x278f('0x2'));var timeout=require(_0x278f('0x3'));var express=require(_0x278f('0x4'));var router=express['Router']();var auth=require(_0x278f('0x5'));var interaction=require(_0x278f('0x6'));var config=require(_0x278f('0x7'));var controller=require(_0x278f('0x8'));router[_0x278f('0x9')]('/',auth[_0x278f('0xa')](),controller[_0x278f('0xb')]);router[_0x278f('0x9')](_0x278f('0xc'),auth[_0x278f('0xa')](),controller[_0x278f('0xd')]);router['get'](_0x278f('0xe'),auth['isAuthenticated'](),controller[_0x278f('0xf')]);var upload=multer({'storage':multer[_0x278f('0x10')]({'destination':function(_0x2971ee,_0x26059f,_0x4da347){_0x4da347(null,path[_0x278f('0x11')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x3f5199,_0x4e0365,_0x47b4bd){_0x4e0365[_0x278f('0x12')]=_0x4e0365[_0x278f('0x12')][_0x278f('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x47b4bd(null,util[_0x278f('0x14')]('%s-%s%s',path[_0x278f('0x15')](_0x4e0365[_0x278f('0x12')],path['extname'](_0x4e0365[_0x278f('0x12')])),Date[_0x278f('0x16')](),path['extname'](_0x4e0365[_0x278f('0x12')])));}})});router[_0x278f('0x17')]('/',upload[_0x278f('0x18')](_0x278f('0x19')),controller[_0x278f('0x1a')]);router[_0x278f('0x1b')](_0x278f('0xc'),auth['isAuthenticated'](),controller[_0x278f('0x1c')]);router[_0x278f('0x1d')](_0x278f('0xc'),auth['isAuthenticated'](),controller[_0x278f('0x1d')]);module[_0x278f('0x1e')]=router;