Built motion from commit 4a17b4ed.|2.6.17
[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 _0xef8c=['put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','extname','now','post','create'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0xef8c,0x1a7));var _0xcef8=function(_0x3ae4bf,_0x554978){_0x3ae4bf=_0x3ae4bf-0x0;var _0x27f7dd=_0xef8c[_0x3ae4bf];return _0x27f7dd;};'use strict';var multer=require(_0xcef8('0x0'));var util=require(_0xcef8('0x1'));var path=require(_0xcef8('0x2'));var timeout=require(_0xcef8('0x3'));var express=require(_0xcef8('0x4'));var router=express['Router']();var fs_extra=require(_0xcef8('0x5'));var auth=require(_0xcef8('0x6'));var interaction=require(_0xcef8('0x7'));var config=require(_0xcef8('0x8'));var controller=require(_0xcef8('0x9'));router[_0xcef8('0xa')]('/',auth[_0xcef8('0xb')](),controller[_0xcef8('0xc')]);router[_0xcef8('0xa')](_0xcef8('0xd'),auth['isAuthenticated'](),controller[_0xcef8('0xe')]);router['get']('/:id/download',auth[_0xcef8('0xb')](),controller[_0xcef8('0xf')]);var upload=multer({'storage':multer[_0xcef8('0x10')]({'destination':function(_0x265e6b,_0x2d35f1,_0x128d57){_0x128d57(null,path[_0xcef8('0x11')](config[_0xcef8('0x12')],_0xcef8('0x13')));},'filename':function(_0x498d70,_0x17b92c,_0x1a1c36){_0x17b92c[_0xcef8('0x14')]=_0x17b92c[_0xcef8('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1a1c36(null,util[_0xcef8('0x15')](_0xcef8('0x16'),path['basename'](_0x17b92c[_0xcef8('0x14')],path[_0xcef8('0x17')](_0x17b92c[_0xcef8('0x14')])),Date[_0xcef8('0x18')](),path['extname'](_0x17b92c[_0xcef8('0x14')])));}})});router[_0xcef8('0x19')]('/',upload['single']('file'),controller[_0xcef8('0x1a')]);router[_0xcef8('0x1b')]('/:id',auth[_0xcef8('0xb')](),controller['update']);router[_0xcef8('0x1c')](_0xcef8('0xd'),auth[_0xcef8('0xb')](),controller['delete']);module[_0xcef8('0x1d')]=router;