51659328e8c736416fc57cadcdd964dddaee29f9
[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 _0x314c=['basename','extname','now','post','single','file','create','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname'];(function(_0xcbd84c,_0x205c58){var _0x2ce1c2=function(_0x4e3d98){while(--_0x4e3d98){_0xcbd84c['push'](_0xcbd84c['shift']());}};_0x2ce1c2(++_0x205c58);}(_0x314c,0x175));var _0xc314=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x314c[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xc314('0x0'));var util=require('util');var path=require(_0xc314('0x1'));var timeout=require(_0xc314('0x2'));var express=require(_0xc314('0x3'));var router=express[_0xc314('0x4')]();var auth=require(_0xc314('0x5'));var interaction=require(_0xc314('0x6'));var config=require(_0xc314('0x7'));var controller=require('./sound.controller');router['get']('/',auth[_0xc314('0x8')](),controller[_0xc314('0x9')]);router[_0xc314('0xa')](_0xc314('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xc314('0xc'),auth[_0xc314('0x8')](),controller[_0xc314('0xd')]);var upload=multer({'storage':multer[_0xc314('0xe')]({'destination':function(_0x49d4cc,_0x62ea3b,_0x52bdfc){_0x52bdfc(null,path[_0xc314('0xf')](config[_0xc314('0x10')],_0xc314('0x11')));},'filename':function(_0x532361,_0x1414b3,_0x25f2ec){_0x1414b3[_0xc314('0x12')]=_0x1414b3[_0xc314('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x25f2ec(null,util['format']('%s-%s%s',path[_0xc314('0x13')](_0x1414b3[_0xc314('0x12')],path[_0xc314('0x14')](_0x1414b3[_0xc314('0x12')])),Date[_0xc314('0x15')](),path['extname'](_0x1414b3[_0xc314('0x12')])));}})});router[_0xc314('0x16')]('/',upload[_0xc314('0x17')](_0xc314('0x18')),controller[_0xc314('0x19')]);router['put'](_0xc314('0xb'),auth['isAuthenticated'](),controller[_0xc314('0x1a')]);router[_0xc314('0x1b')](_0xc314('0xb'),auth['isAuthenticated'](),controller[_0xc314('0x1b')]);module['exports']=router;