Built motion from commit (unavailable).|2.4.15
[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 _0xc8e6=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create'];(function(_0x1ff871,_0x22e6cb){var _0x4b773b=function(_0x25eb05){while(--_0x25eb05){_0x1ff871['push'](_0x1ff871['shift']());}};_0x4b773b(++_0x22e6cb);}(_0xc8e6,0xd0));var _0x6c8e=function(_0x1abb18,_0x3960ec){_0x1abb18=_0x1abb18-0x0;var _0x2a4e44=_0xc8e6[_0x1abb18];return _0x2a4e44;};'use strict';var multer=require(_0x6c8e('0x0'));var util=require(_0x6c8e('0x1'));var path=require(_0x6c8e('0x2'));var timeout=require(_0x6c8e('0x3'));var express=require(_0x6c8e('0x4'));var router=express[_0x6c8e('0x5')]();var auth=require(_0x6c8e('0x6'));var interaction=require(_0x6c8e('0x7'));var config=require('../../config/environment');var controller=require(_0x6c8e('0x8'));router[_0x6c8e('0x9')]('/',auth[_0x6c8e('0xa')](),controller[_0x6c8e('0xb')]);router[_0x6c8e('0x9')](_0x6c8e('0xc'),auth[_0x6c8e('0xa')](),controller[_0x6c8e('0xd')]);router[_0x6c8e('0x9')](_0x6c8e('0xe'),auth['isAuthenticated'](),controller[_0x6c8e('0xf')]);var upload=multer({'storage':multer[_0x6c8e('0x10')]({'destination':function(_0x1c0c20,_0x5b1e97,_0x3b3af4){_0x3b3af4(null,path[_0x6c8e('0x11')](config[_0x6c8e('0x12')],'server/files/sounds/original/'));},'filename':function(_0x4ad173,_0x1491f3,_0x3bc973){_0x1491f3[_0x6c8e('0x13')]=_0x1491f3[_0x6c8e('0x13')][_0x6c8e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3bc973(null,util[_0x6c8e('0x15')](_0x6c8e('0x16'),path[_0x6c8e('0x17')](_0x1491f3['originalname'],path[_0x6c8e('0x18')](_0x1491f3[_0x6c8e('0x13')])),Date[_0x6c8e('0x19')](),path[_0x6c8e('0x18')](_0x1491f3[_0x6c8e('0x13')])));}})});router[_0x6c8e('0x1a')]('/',upload[_0x6c8e('0x1b')](_0x6c8e('0x1c')),controller[_0x6c8e('0x1d')]);router[_0x6c8e('0x1e')](_0x6c8e('0xc'),auth[_0x6c8e('0xa')](),controller[_0x6c8e('0x1f')]);router[_0x6c8e('0x20')]('/:id',auth[_0x6c8e('0xa')](),controller['delete']);module[_0x6c8e('0x21')]=router;