38ebd692ea9cd91b66d7611e66a68626c6c19842
[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 _0x7c6d=['originalname','replace','%s-%s%s','basename','extname','post','file','create','put','delete','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/'];(function(_0xddafcc,_0x5e601f){var _0x511cb1=function(_0x58d3ad){while(--_0x58d3ad){_0xddafcc['push'](_0xddafcc['shift']());}};_0x511cb1(++_0x5e601f);}(_0x7c6d,0x15a));var _0xd7c6=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x7c6d[_0x125ff8];return _0x2d9ef;};'use strict';var multer=require(_0xd7c6('0x0'));var util=require(_0xd7c6('0x1'));var path=require('path');var timeout=require(_0xd7c6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd7c6('0x3'));var auth=require(_0xd7c6('0x4'));var interaction=require(_0xd7c6('0x5'));var config=require('../../config/environment');var controller=require(_0xd7c6('0x6'));router[_0xd7c6('0x7')]('/',auth[_0xd7c6('0x8')](),controller[_0xd7c6('0x9')]);router[_0xd7c6('0x7')](_0xd7c6('0xa'),auth['isAuthenticated'](),controller[_0xd7c6('0xb')]);router['get'](_0xd7c6('0xc'),auth[_0xd7c6('0x8')](),controller[_0xd7c6('0xd')]);var upload=multer({'storage':multer[_0xd7c6('0xe')]({'destination':function(_0x50521a,_0x110ae7,_0x12bab2){_0x12bab2(null,path[_0xd7c6('0xf')](config[_0xd7c6('0x10')],_0xd7c6('0x11')));},'filename':function(_0x32cf01,_0x2ba01f,_0x3b712c){_0x2ba01f['originalname']=_0x2ba01f[_0xd7c6('0x12')][_0xd7c6('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3b712c(null,util['format'](_0xd7c6('0x14'),path[_0xd7c6('0x15')](_0x2ba01f[_0xd7c6('0x12')],path[_0xd7c6('0x16')](_0x2ba01f[_0xd7c6('0x12')])),Date['now'](),path[_0xd7c6('0x16')](_0x2ba01f['originalname'])));}})});router[_0xd7c6('0x17')]('/',upload['single'](_0xd7c6('0x18')),controller[_0xd7c6('0x19')]);router[_0xd7c6('0x1a')](_0xd7c6('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xd7c6('0x1b')]('/:id',auth[_0xd7c6('0x8')](),controller[_0xd7c6('0x1b')]);module['exports']=router;