Built motion from commit f8768ebe.|2.6.15
[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 _0x3752=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','single','file','create','put','update','delete'];(function(_0x297ea8,_0x515202){var _0x1188bd=function(_0x29fba7){while(--_0x29fba7){_0x297ea8['push'](_0x297ea8['shift']());}};_0x1188bd(++_0x515202);}(_0x3752,0x161));var _0x2375=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0x3752[_0x2a558d];return _0xa7bc9c;};'use strict';var multer=require(_0x2375('0x0'));var util=require(_0x2375('0x1'));var path=require(_0x2375('0x2'));var timeout=require(_0x2375('0x3'));var express=require(_0x2375('0x4'));var router=express[_0x2375('0x5')]();var fs_extra=require(_0x2375('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2375('0x7'));var controller=require(_0x2375('0x8'));router['get']('/',auth[_0x2375('0x9')](),controller[_0x2375('0xa')]);router[_0x2375('0xb')](_0x2375('0xc'),auth[_0x2375('0x9')](),controller[_0x2375('0xd')]);router[_0x2375('0xb')](_0x2375('0xe'),auth['isAuthenticated'](),controller[_0x2375('0xf')]);var upload=multer({'storage':multer[_0x2375('0x10')]({'destination':function(_0x2f737f,_0x40f40a,_0x149db){_0x149db(null,path[_0x2375('0x11')](config['root'],_0x2375('0x12')));},'filename':function(_0xc258cd,_0x1edaf3,_0x4d76f3){_0x1edaf3[_0x2375('0x13')]=_0x1edaf3[_0x2375('0x13')][_0x2375('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4d76f3(null,util['format'](_0x2375('0x15'),path[_0x2375('0x16')](_0x1edaf3[_0x2375('0x13')],path[_0x2375('0x17')](_0x1edaf3['originalname'])),Date[_0x2375('0x18')](),path[_0x2375('0x17')](_0x1edaf3[_0x2375('0x13')])));}})});router['post']('/',upload[_0x2375('0x19')](_0x2375('0x1a')),controller[_0x2375('0x1b')]);router[_0x2375('0x1c')](_0x2375('0xc'),auth['isAuthenticated'](),controller[_0x2375('0x1d')]);router['delete']('/:id',auth[_0x2375('0x9')](),controller[_0x2375('0x1e')]);module[_0x2375('0x1f')]=router;