Built motion from commit fe909640.|2.6.8
[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 _0x37a7=['util','Router','fs-extra','./sound.controller','get','isAuthenticated','index','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','create','put','/:id','delete','multer'];(function(_0x3b5a43,_0x4b4c71){var _0x32b606=function(_0xc4186){while(--_0xc4186){_0x3b5a43['push'](_0x3b5a43['shift']());}};_0x32b606(++_0x4b4c71);}(_0x37a7,0x6f));var _0x737a=function(_0x235487,_0x3d254f){_0x235487=_0x235487-0x0;var _0x25141a=_0x37a7[_0x235487];return _0x25141a;};'use strict';var multer=require(_0x737a('0x0'));var util=require(_0x737a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x737a('0x2')]();var fs_extra=require(_0x737a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x737a('0x4'));router[_0x737a('0x5')]('/',auth[_0x737a('0x6')](),controller[_0x737a('0x7')]);router[_0x737a('0x5')]('/:id',auth[_0x737a('0x6')](),controller[_0x737a('0x8')]);router[_0x737a('0x5')](_0x737a('0x9'),auth['isAuthenticated'](),controller[_0x737a('0xa')]);var upload=multer({'storage':multer[_0x737a('0xb')]({'destination':function(_0x5ad258,_0x2b1c32,_0x192e18){_0x192e18(null,path[_0x737a('0xc')](config[_0x737a('0xd')],_0x737a('0xe')));},'filename':function(_0x27ccd9,_0x2b34f2,_0x4bcf5e){_0x2b34f2[_0x737a('0xf')]=_0x2b34f2[_0x737a('0xf')][_0x737a('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4bcf5e(null,util[_0x737a('0x11')](_0x737a('0x12'),path[_0x737a('0x13')](_0x2b34f2[_0x737a('0xf')],path[_0x737a('0x14')](_0x2b34f2['originalname'])),Date[_0x737a('0x15')](),path[_0x737a('0x14')](_0x2b34f2['originalname'])));}})});router['post']('/',upload[_0x737a('0x16')](_0x737a('0x17')),controller[_0x737a('0x18')]);router[_0x737a('0x19')](_0x737a('0x1a'),auth[_0x737a('0x6')](),controller['update']);router[_0x737a('0x1b')]('/:id',auth[_0x737a('0x6')](),controller[_0x737a('0x1b')]);module['exports']=router;