Built motion from commit (unavailable).|2.5.30
[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 _0x715c=['extname','now','file','create','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format'];(function(_0x132c5b,_0x3d26c1){var _0x1a8b61=function(_0x3f2be5){while(--_0x3f2be5){_0x132c5b['push'](_0x132c5b['shift']());}};_0x1a8b61(++_0x3d26c1);}(_0x715c,0xbc));var _0xc715=function(_0x26176f,_0x28bd01){_0x26176f=_0x26176f-0x0;var _0x569698=_0x715c[_0x26176f];return _0x569698;};'use strict';var multer=require(_0xc715('0x0'));var util=require(_0xc715('0x1'));var path=require(_0xc715('0x2'));var timeout=require(_0xc715('0x3'));var express=require(_0xc715('0x4'));var router=express[_0xc715('0x5')]();var fs_extra=require(_0xc715('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc715('0x7'));var config=require(_0xc715('0x8'));var controller=require('./sound.controller');router['get']('/',auth[_0xc715('0x9')](),controller['index']);router[_0xc715('0xa')](_0xc715('0xb'),auth[_0xc715('0x9')](),controller['show']);router[_0xc715('0xa')](_0xc715('0xc'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0xc715('0xd')]({'destination':function(_0x6844e1,_0x2753af,_0x4f12a5){_0x4f12a5(null,path[_0xc715('0xe')](config[_0xc715('0xf')],_0xc715('0x10')));},'filename':function(_0x567a25,_0x29649c,_0x25d32a){_0x29649c[_0xc715('0x11')]=_0x29649c['originalname'][_0xc715('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x25d32a(null,util[_0xc715('0x13')]('%s-%s%s',path['basename'](_0x29649c[_0xc715('0x11')],path[_0xc715('0x14')](_0x29649c[_0xc715('0x11')])),Date[_0xc715('0x15')](),path[_0xc715('0x14')](_0x29649c[_0xc715('0x11')])));}})});router['post']('/',upload['single'](_0xc715('0x16')),controller[_0xc715('0x17')]);router['put'](_0xc715('0xb'),auth[_0xc715('0x9')](),controller[_0xc715('0x18')]);router['delete'](_0xc715('0xb'),auth['isAuthenticated'](),controller[_0xc715('0x19')]);module['exports']=router;