Built motion from commit b5413ace.|2.6.9
[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 _0x3779=['index','isAuthenticated','show','/:id/download','download','join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','/:id','update','delete','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x48deac,_0x4d8ab8){var _0x3b5eaa=function(_0x91c61e){while(--_0x91c61e){_0x48deac['push'](_0x48deac['shift']());}};_0x3b5eaa(++_0x4d8ab8);}(_0x3779,0x155));var _0x9377=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0x3779[_0x305c31];return _0x17f39f;};'use strict';var multer=require(_0x9377('0x0'));var util=require(_0x9377('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9377('0x2')]();var fs_extra=require(_0x9377('0x3'));var auth=require(_0x9377('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9377('0x5'));var controller=require('./sound.controller');router[_0x9377('0x6')]('/',auth['isAuthenticated'](),controller[_0x9377('0x7')]);router[_0x9377('0x6')]('/:id',auth[_0x9377('0x8')](),controller[_0x9377('0x9')]);router['get'](_0x9377('0xa'),auth[_0x9377('0x8')](),controller[_0x9377('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22526b,_0x567481,_0x28036b){_0x28036b(null,path[_0x9377('0xc')](config['root'],_0x9377('0xd')));},'filename':function(_0x6ecee6,_0x1df23f,_0x5f165e){_0x1df23f[_0x9377('0xe')]=_0x1df23f[_0x9377('0xe')][_0x9377('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5f165e(null,util[_0x9377('0x10')](_0x9377('0x11'),path[_0x9377('0x12')](_0x1df23f[_0x9377('0xe')],path[_0x9377('0x13')](_0x1df23f[_0x9377('0xe')])),Date[_0x9377('0x14')](),path[_0x9377('0x13')](_0x1df23f[_0x9377('0xe')])));}})});router[_0x9377('0x15')]('/',upload[_0x9377('0x16')](_0x9377('0x17')),controller[_0x9377('0x18')]);router['put'](_0x9377('0x19'),auth[_0x9377('0x8')](),controller[_0x9377('0x1a')]);router[_0x9377('0x1b')](_0x9377('0x19'),auth[_0x9377('0x8')](),controller[_0x9377('0x1b')]);module[_0x9377('0x1c')]=router;