Built motion from commit 47436d59.|2.6.7
[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 _0x7e08=['join','root','server/files/sounds/original/','originalname','%s-%s%s','basename','extname','post','file','create','put','update','delete','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x7e08,0x186));var _0x87e0=function(_0x1a833c,_0x1dbe27){_0x1a833c=_0x1a833c-0x0;var _0x442c73=_0x7e08[_0x1a833c];return _0x442c73;};'use strict';var multer=require(_0x87e0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x87e0('0x1'));var router=express[_0x87e0('0x2')]();var fs_extra=require(_0x87e0('0x3'));var auth=require(_0x87e0('0x4'));var interaction=require(_0x87e0('0x5'));var config=require(_0x87e0('0x6'));var controller=require(_0x87e0('0x7'));router[_0x87e0('0x8')]('/',auth[_0x87e0('0x9')](),controller[_0x87e0('0xa')]);router[_0x87e0('0x8')](_0x87e0('0xb'),auth[_0x87e0('0x9')](),controller[_0x87e0('0xc')]);router[_0x87e0('0x8')](_0x87e0('0xd'),auth['isAuthenticated'](),controller[_0x87e0('0xe')]);var upload=multer({'storage':multer[_0x87e0('0xf')]({'destination':function(_0x4849c2,_0x4d1a4b,_0xe0db3c){_0xe0db3c(null,path[_0x87e0('0x10')](config[_0x87e0('0x11')],_0x87e0('0x12')));},'filename':function(_0x58d6ae,_0x2f8acd,_0x2d7402){_0x2f8acd[_0x87e0('0x13')]=_0x2f8acd[_0x87e0('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2d7402(null,util['format'](_0x87e0('0x14'),path[_0x87e0('0x15')](_0x2f8acd[_0x87e0('0x13')],path[_0x87e0('0x16')](_0x2f8acd[_0x87e0('0x13')])),Date['now'](),path[_0x87e0('0x16')](_0x2f8acd[_0x87e0('0x13')])));}})});router[_0x87e0('0x17')]('/',upload['single'](_0x87e0('0x18')),controller[_0x87e0('0x19')]);router[_0x87e0('0x1a')](_0x87e0('0xb'),auth[_0x87e0('0x9')](),controller[_0x87e0('0x1b')]);router[_0x87e0('0x1c')](_0x87e0('0xb'),auth[_0x87e0('0x9')](),controller[_0x87e0('0x1c')]);module['exports']=router;