Built motion from commit (unavailable).|2.5.1
[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 _0xab47=['get','isAuthenticated','/:id','show','/:id/download','download','join','root','server/files/sounds/original/','originalname','format','extname','post','single','file','create','put','update','delete','exports','multer','path','express','Router','../../components/auth/service'];(function(_0xd6c392,_0x273124){var _0x4afb67=function(_0x3c7d94){while(--_0x3c7d94){_0xd6c392['push'](_0xd6c392['shift']());}};_0x4afb67(++_0x273124);}(_0xab47,0x1bd));var _0x7ab4=function(_0x21b36c,_0x543483){_0x21b36c=_0x21b36c-0x0;var _0x236627=_0xab47[_0x21b36c];return _0x236627;};'use strict';var multer=require(_0x7ab4('0x0'));var util=require('util');var path=require(_0x7ab4('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ab4('0x2'));var router=express[_0x7ab4('0x3')]();var auth=require(_0x7ab4('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x7ab4('0x5')]('/',auth[_0x7ab4('0x6')](),controller['index']);router[_0x7ab4('0x5')](_0x7ab4('0x7'),auth[_0x7ab4('0x6')](),controller[_0x7ab4('0x8')]);router[_0x7ab4('0x5')](_0x7ab4('0x9'),auth[_0x7ab4('0x6')](),controller[_0x7ab4('0xa')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4ec38c,_0x494f75,_0x5f51b8){_0x5f51b8(null,path[_0x7ab4('0xb')](config[_0x7ab4('0xc')],_0x7ab4('0xd')));},'filename':function(_0xb4ec19,_0x2e9a40,_0x1c9346){_0x2e9a40[_0x7ab4('0xe')]=_0x2e9a40['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1c9346(null,util[_0x7ab4('0xf')]('%s-%s%s',path['basename'](_0x2e9a40[_0x7ab4('0xe')],path[_0x7ab4('0x10')](_0x2e9a40[_0x7ab4('0xe')])),Date['now'](),path['extname'](_0x2e9a40[_0x7ab4('0xe')])));}})});router[_0x7ab4('0x11')]('/',upload[_0x7ab4('0x12')](_0x7ab4('0x13')),controller[_0x7ab4('0x14')]);router[_0x7ab4('0x15')](_0x7ab4('0x7'),auth[_0x7ab4('0x6')](),controller[_0x7ab4('0x16')]);router[_0x7ab4('0x17')](_0x7ab4('0x7'),auth[_0x7ab4('0x6')](),controller[_0x7ab4('0x17')]);module[_0x7ab4('0x18')]=router;