Built motion from commit (unavailable).|2.5.29
[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 _0x55a3=['./sound.controller','get','isAuthenticated','index','show','/:id/download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x53559,_0x45d570){var _0x45ce36=function(_0xfa1c01){while(--_0xfa1c01){_0x53559['push'](_0x53559['shift']());}};_0x45ce36(++_0x45d570);}(_0x55a3,0x81));var _0x355a=function(_0x162f4b,_0x31b569){_0x162f4b=_0x162f4b-0x0;var _0x57b00b=_0x55a3[_0x162f4b];return _0x57b00b;};'use strict';var multer=require(_0x355a('0x0'));var util=require(_0x355a('0x1'));var path=require('path');var timeout=require(_0x355a('0x2'));var express=require('express');var router=express[_0x355a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x355a('0x4'));var config=require(_0x355a('0x5'));var controller=require(_0x355a('0x6'));router[_0x355a('0x7')]('/',auth[_0x355a('0x8')](),controller[_0x355a('0x9')]);router[_0x355a('0x7')]('/:id',auth[_0x355a('0x8')](),controller[_0x355a('0xa')]);router[_0x355a('0x7')](_0x355a('0xb'),auth[_0x355a('0x8')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a4290,_0x4f1bf1,_0x52f1a1){_0x52f1a1(null,path[_0x355a('0xc')](config[_0x355a('0xd')],_0x355a('0xe')));},'filename':function(_0x45f939,_0x34ef3f,_0x125b94){_0x34ef3f[_0x355a('0xf')]=_0x34ef3f[_0x355a('0xf')][_0x355a('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x125b94(null,util[_0x355a('0x11')](_0x355a('0x12'),path['basename'](_0x34ef3f[_0x355a('0xf')],path[_0x355a('0x13')](_0x34ef3f[_0x355a('0xf')])),Date['now'](),path[_0x355a('0x13')](_0x34ef3f[_0x355a('0xf')])));}})});router[_0x355a('0x14')]('/',upload['single']('file'),controller[_0x355a('0x15')]);router[_0x355a('0x16')](_0x355a('0x17'),auth[_0x355a('0x8')](),controller[_0x355a('0x18')]);router[_0x355a('0x19')](_0x355a('0x17'),auth[_0x355a('0x8')](),controller[_0x355a('0x19')]);module[_0x355a('0x1a')]=router;