Built motion from commit (unavailable).|2.4.3
[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 _0x82df=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','basename','extname','single','file','/:id','update','delete','exports','multer','path','connect-timeout','Router'];(function(_0x5f4922,_0x492511){var _0x2d4332=function(_0x4e7e35){while(--_0x4e7e35){_0x5f4922['push'](_0x5f4922['shift']());}};_0x2d4332(++_0x492511);}(_0x82df,0x68));var _0xf82d=function(_0x25a471,_0x33cb10){_0x25a471=_0x25a471-0x0;var _0x2e59a0=_0x82df[_0x25a471];return _0x2e59a0;};'use strict';var multer=require(_0xf82d('0x0'));var util=require('util');var path=require(_0xf82d('0x1'));var timeout=require(_0xf82d('0x2'));var express=require('express');var router=express[_0xf82d('0x3')]();var auth=require(_0xf82d('0x4'));var interaction=require(_0xf82d('0x5'));var config=require(_0xf82d('0x6'));var controller=require('./sound.controller');router[_0xf82d('0x7')]('/',auth[_0xf82d('0x8')](),controller[_0xf82d('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf82d('0xa')]);router[_0xf82d('0x7')](_0xf82d('0xb'),auth[_0xf82d('0x8')](),controller[_0xf82d('0xc')]);var upload=multer({'storage':multer[_0xf82d('0xd')]({'destination':function(_0x57b8ba,_0x74602c,_0x480977){_0x480977(null,path[_0xf82d('0xe')](config[_0xf82d('0xf')],_0xf82d('0x10')));},'filename':function(_0x4588cc,_0x8a8e28,_0x4101ef){_0x8a8e28[_0xf82d('0x11')]=_0x8a8e28[_0xf82d('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4101ef(null,util[_0xf82d('0x12')]('%s-%s%s',path[_0xf82d('0x13')](_0x8a8e28[_0xf82d('0x11')],path[_0xf82d('0x14')](_0x8a8e28[_0xf82d('0x11')])),Date['now'](),path['extname'](_0x8a8e28[_0xf82d('0x11')])));}})});router['post']('/',upload[_0xf82d('0x15')](_0xf82d('0x16')),controller['create']);router['put'](_0xf82d('0x17'),auth[_0xf82d('0x8')](),controller[_0xf82d('0x18')]);router['delete']('/:id',auth[_0xf82d('0x8')](),controller[_0xf82d('0x19')]);module[_0xf82d('0x1a')]=router;