Built motion from commit b5996064.|2.6.21
[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 _0xfd66=['/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','create','put','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','./sound.controller','get','isAuthenticated','index','/:id','show'];(function(_0x41f638,_0x258d7b){var _0x58d6b6=function(_0x4b9f5a){while(--_0x4b9f5a){_0x41f638['push'](_0x41f638['shift']());}};_0x58d6b6(++_0x258d7b);}(_0xfd66,0x71));var _0x6fd6=function(_0x22037f,_0x1f3e09){_0x22037f=_0x22037f-0x0;var _0x1b5dd5=_0xfd66[_0x22037f];return _0x1b5dd5;};'use strict';var multer=require(_0x6fd6('0x0'));var util=require(_0x6fd6('0x1'));var path=require('path');var timeout=require(_0x6fd6('0x2'));var express=require('express');var router=express[_0x6fd6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6fd6('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6fd6('0x5'));router[_0x6fd6('0x6')]('/',auth[_0x6fd6('0x7')](),controller[_0x6fd6('0x8')]);router[_0x6fd6('0x6')](_0x6fd6('0x9'),auth[_0x6fd6('0x7')](),controller[_0x6fd6('0xa')]);router['get'](_0x6fd6('0xb'),auth[_0x6fd6('0x7')](),controller[_0x6fd6('0xc')]);var upload=multer({'storage':multer[_0x6fd6('0xd')]({'destination':function(_0x57fc08,_0x3bb0af,_0x43b18e){_0x43b18e(null,path[_0x6fd6('0xe')](config[_0x6fd6('0xf')],_0x6fd6('0x10')));},'filename':function(_0xc31900,_0x35dd61,_0x2f3599){_0x35dd61['originalname']=_0x35dd61[_0x6fd6('0x11')][_0x6fd6('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2f3599(null,util[_0x6fd6('0x13')](_0x6fd6('0x14'),path[_0x6fd6('0x15')](_0x35dd61[_0x6fd6('0x11')],path[_0x6fd6('0x16')](_0x35dd61[_0x6fd6('0x11')])),Date[_0x6fd6('0x17')](),path[_0x6fd6('0x16')](_0x35dd61[_0x6fd6('0x11')])));}})});router[_0x6fd6('0x18')]('/',upload['single'](_0x6fd6('0x19')),controller[_0x6fd6('0x1a')]);router[_0x6fd6('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x6fd6('0x1c')]);router[_0x6fd6('0x1d')]('/:id',auth[_0x6fd6('0x7')](),controller[_0x6fd6('0x1d')]);module[_0x6fd6('0x1e')]=router;