b6ebd7ae6bd2c2369bd7798b31c3ec5b101e88f2
[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 _0x286f=['../../config/environment','get','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','create','put','/:id','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x286f,0x160));var _0xf286=function(_0x33ebf7,_0x4820e3){_0x33ebf7=_0x33ebf7-0x0;var _0xdc6fc4=_0x286f[_0x33ebf7];return _0xdc6fc4;};'use strict';var multer=require(_0xf286('0x0'));var util=require(_0xf286('0x1'));var path=require(_0xf286('0x2'));var timeout=require(_0xf286('0x3'));var express=require(_0xf286('0x4'));var router=express[_0xf286('0x5')]();var auth=require(_0xf286('0x6'));var interaction=require(_0xf286('0x7'));var config=require(_0xf286('0x8'));var controller=require('./sound.controller');router[_0xf286('0x9')]('/',auth[_0xf286('0xa')](),controller['index']);router[_0xf286('0x9')]('/:id',auth[_0xf286('0xa')](),controller[_0xf286('0xb')]);router[_0xf286('0x9')](_0xf286('0xc'),auth[_0xf286('0xa')](),controller[_0xf286('0xd')]);var upload=multer({'storage':multer[_0xf286('0xe')]({'destination':function(_0x704d5b,_0x587991,_0x7ddfc1){_0x7ddfc1(null,path[_0xf286('0xf')](config[_0xf286('0x10')],'server/files/sounds/original/'));},'filename':function(_0x3ccafa,_0x40ba19,_0x3c812b){_0x40ba19[_0xf286('0x11')]=_0x40ba19[_0xf286('0x11')][_0xf286('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3c812b(null,util[_0xf286('0x13')](_0xf286('0x14'),path[_0xf286('0x15')](_0x40ba19[_0xf286('0x11')],path[_0xf286('0x16')](_0x40ba19[_0xf286('0x11')])),Date[_0xf286('0x17')](),path[_0xf286('0x16')](_0x40ba19[_0xf286('0x11')])));}})});router[_0xf286('0x18')]('/',upload['single'](_0xf286('0x19')),controller[_0xf286('0x1a')]);router[_0xf286('0x1b')](_0xf286('0x1c'),auth[_0xf286('0xa')](),controller['update']);router[_0xf286('0x1d')](_0xf286('0x1c'),auth['isAuthenticated'](),controller[_0xf286('0x1d')]);module['exports']=router;