Built motion from commit 21186556.|2.6.19
[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 _0x20ba=['replace','format','%s-%s%s','basename','extname','now','file','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./sound.controller','get','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20ba,0x84));var _0xa20b=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x20ba[_0x17928f];return _0x500b63;};'use strict';var multer=require('multer');var util=require(_0xa20b('0x0'));var path=require(_0xa20b('0x1'));var timeout=require(_0xa20b('0x2'));var express=require(_0xa20b('0x3'));var router=express[_0xa20b('0x4')]();var fs_extra=require(_0xa20b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa20b('0x6'));var config=require('../../config/environment');var controller=require(_0xa20b('0x7'));router[_0xa20b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa20b('0x8')](_0xa20b('0x9'),auth[_0xa20b('0xa')](),controller[_0xa20b('0xb')]);router[_0xa20b('0x8')](_0xa20b('0xc'),auth['isAuthenticated'](),controller[_0xa20b('0xd')]);var upload=multer({'storage':multer[_0xa20b('0xe')]({'destination':function(_0x41d04c,_0x44811d,_0x2263e1){_0x2263e1(null,path[_0xa20b('0xf')](config['root'],_0xa20b('0x10')));},'filename':function(_0x5f3400,_0x82e511,_0x4cc6bb){_0x82e511[_0xa20b('0x11')]=_0x82e511['originalname'][_0xa20b('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4cc6bb(null,util[_0xa20b('0x13')](_0xa20b('0x14'),path[_0xa20b('0x15')](_0x82e511[_0xa20b('0x11')],path[_0xa20b('0x16')](_0x82e511[_0xa20b('0x11')])),Date[_0xa20b('0x17')](),path['extname'](_0x82e511[_0xa20b('0x11')])));}})});router['post']('/',upload['single'](_0xa20b('0x18')),controller[_0xa20b('0x19')]);router[_0xa20b('0x1a')]('/:id',auth[_0xa20b('0xa')](),controller[_0xa20b('0x1b')]);router[_0xa20b('0x1c')]('/:id',auth[_0xa20b('0xa')](),controller['delete']);module[_0xa20b('0x1d')]=router;