cf43f0eb8c779cb31133988f69ab03593b469eb6
[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 _0x500c=['basename','originalname','now','post','single','file','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','replace','format','%s-%s%s'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x500c,0x8a));var _0xc500=function(_0x4a28d4,_0x3b73b4){_0x4a28d4=_0x4a28d4-0x0;var _0x40e0f6=_0x500c[_0x4a28d4];return _0x40e0f6;};'use strict';var multer=require(_0xc500('0x0'));var util=require(_0xc500('0x1'));var path=require('path');var timeout=require(_0xc500('0x2'));var express=require(_0xc500('0x3'));var router=express[_0xc500('0x4')]();var fs_extra=require(_0xc500('0x5'));var auth=require(_0xc500('0x6'));var interaction=require(_0xc500('0x7'));var config=require(_0xc500('0x8'));var controller=require(_0xc500('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xc500('0xa')]);router['get'](_0xc500('0xb'),auth[_0xc500('0xc')](),controller[_0xc500('0xd')]);router['get'](_0xc500('0xe'),auth[_0xc500('0xc')](),controller[_0xc500('0xf')]);var upload=multer({'storage':multer[_0xc500('0x10')]({'destination':function(_0x3783df,_0xf2eab8,_0x5f0ef7){_0x5f0ef7(null,path[_0xc500('0x11')](config['root'],_0xc500('0x12')));},'filename':function(_0x3076e8,_0x1e16c9,_0x4668f0){_0x1e16c9['originalname']=_0x1e16c9['originalname'][_0xc500('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4668f0(null,util[_0xc500('0x14')](_0xc500('0x15'),path[_0xc500('0x16')](_0x1e16c9[_0xc500('0x17')],path['extname'](_0x1e16c9[_0xc500('0x17')])),Date[_0xc500('0x18')](),path['extname'](_0x1e16c9[_0xc500('0x17')])));}})});router[_0xc500('0x19')]('/',upload[_0xc500('0x1a')](_0xc500('0x1b')),controller[_0xc500('0x1c')]);router[_0xc500('0x1d')](_0xc500('0xb'),auth[_0xc500('0xc')](),controller[_0xc500('0x1e')]);router[_0xc500('0x1f')](_0xc500('0xb'),auth[_0xc500('0xc')](),controller[_0xc500('0x1f')]);module['exports']=router;