Built motion from commit (unavailable).|2.4.17
[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 _0x876e=['server/files/sounds/original/','originalname','format','%s-%s%s','extname','now','post','single','file','create','put','update','delete','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','root'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x876e,0x1ee));var _0xe876=function(_0x2ffb74,_0x2cad5c){_0x2ffb74=_0x2ffb74-0x0;var _0x173382=_0x876e[_0x2ffb74];return _0x173382;};'use strict';var multer=require(_0xe876('0x0'));var util=require('util');var path=require(_0xe876('0x1'));var timeout=require(_0xe876('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe876('0x3'));var interaction=require(_0xe876('0x4'));var config=require(_0xe876('0x5'));var controller=require(_0xe876('0x6'));router[_0xe876('0x7')]('/',auth[_0xe876('0x8')](),controller[_0xe876('0x9')]);router[_0xe876('0x7')](_0xe876('0xa'),auth[_0xe876('0x8')](),controller[_0xe876('0xb')]);router[_0xe876('0x7')](_0xe876('0xc'),auth[_0xe876('0x8')](),controller[_0xe876('0xd')]);var upload=multer({'storage':multer[_0xe876('0xe')]({'destination':function(_0x1bfdff,_0x5a472f,_0x29f375){_0x29f375(null,path['join'](config[_0xe876('0xf')],_0xe876('0x10')));},'filename':function(_0xf56e2,_0x56e24a,_0x288789){_0x56e24a[_0xe876('0x11')]=_0x56e24a[_0xe876('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x288789(null,util[_0xe876('0x12')](_0xe876('0x13'),path['basename'](_0x56e24a[_0xe876('0x11')],path[_0xe876('0x14')](_0x56e24a[_0xe876('0x11')])),Date[_0xe876('0x15')](),path['extname'](_0x56e24a[_0xe876('0x11')])));}})});router[_0xe876('0x16')]('/',upload[_0xe876('0x17')](_0xe876('0x18')),controller[_0xe876('0x19')]);router[_0xe876('0x1a')]('/:id',auth[_0xe876('0x8')](),controller[_0xe876('0x1b')]);router[_0xe876('0x1c')]('/:id',auth[_0xe876('0x8')](),controller[_0xe876('0x1c')]);module[_0xe876('0x1d')]=router;