92e36ab89be193df3cd5657806bac216931f063f
[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 _0x25db=['show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id'];(function(_0x755d2f,_0x5879b7){var _0x4f6cd3=function(_0x2fe832){while(--_0x2fe832){_0x755d2f['push'](_0x755d2f['shift']());}};_0x4f6cd3(++_0x5879b7);}(_0x25db,0x1e9));var _0xb25d=function(_0xcbac99,_0x5a6090){_0xcbac99=_0xcbac99-0x0;var _0x227280=_0x25db[_0xcbac99];return _0x227280;};'use strict';var multer=require(_0xb25d('0x0'));var util=require(_0xb25d('0x1'));var path=require(_0xb25d('0x2'));var timeout=require(_0xb25d('0x3'));var express=require(_0xb25d('0x4'));var router=express[_0xb25d('0x5')]();var fs_extra=require(_0xb25d('0x6'));var auth=require(_0xb25d('0x7'));var interaction=require(_0xb25d('0x8'));var config=require(_0xb25d('0x9'));var controller=require(_0xb25d('0xa'));router[_0xb25d('0xb')]('/',auth[_0xb25d('0xc')](),controller[_0xb25d('0xd')]);router['get'](_0xb25d('0xe'),auth['isAuthenticated'](),controller[_0xb25d('0xf')]);router['get'](_0xb25d('0x10'),auth[_0xb25d('0xc')](),controller[_0xb25d('0x11')]);var upload=multer({'storage':multer[_0xb25d('0x12')]({'destination':function(_0x1de6db,_0x1479fa,_0x239c4c){_0x239c4c(null,path[_0xb25d('0x13')](config[_0xb25d('0x14')],_0xb25d('0x15')));},'filename':function(_0x4fa7da,_0x56c6ee,_0x1535a4){_0x56c6ee[_0xb25d('0x16')]=_0x56c6ee[_0xb25d('0x16')][_0xb25d('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1535a4(null,util[_0xb25d('0x18')](_0xb25d('0x19'),path[_0xb25d('0x1a')](_0x56c6ee[_0xb25d('0x16')],path[_0xb25d('0x1b')](_0x56c6ee[_0xb25d('0x16')])),Date['now'](),path[_0xb25d('0x1b')](_0x56c6ee[_0xb25d('0x16')])));}})});router[_0xb25d('0x1c')]('/',upload[_0xb25d('0x1d')](_0xb25d('0x1e')),controller[_0xb25d('0x1f')]);router[_0xb25d('0x20')](_0xb25d('0xe'),auth[_0xb25d('0xc')](),controller[_0xb25d('0x21')]);router[_0xb25d('0x22')](_0xb25d('0xe'),auth[_0xb25d('0xc')](),controller['delete']);module[_0xb25d('0x23')]=router;