Built motion from commit (unavailable).|2.5.31
[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 _0x8b7e=['fs-extra','../../components/auth/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','now','post','single','file','create','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x8b7e,0x13b));var _0xe8b7=function(_0x2902c5,_0x390089){_0x2902c5=_0x2902c5-0x0;var _0x491699=_0x8b7e[_0x2902c5];return _0x491699;};'use strict';var multer=require(_0xe8b7('0x0'));var util=require('util');var path=require(_0xe8b7('0x1'));var timeout=require(_0xe8b7('0x2'));var express=require(_0xe8b7('0x3'));var router=express[_0xe8b7('0x4')]();var fs_extra=require(_0xe8b7('0x5'));var auth=require(_0xe8b7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe8b7('0x7'));var controller=require(_0xe8b7('0x8'));router['get']('/',auth[_0xe8b7('0x9')](),controller[_0xe8b7('0xa')]);router[_0xe8b7('0xb')](_0xe8b7('0xc'),auth[_0xe8b7('0x9')](),controller[_0xe8b7('0xd')]);router[_0xe8b7('0xb')](_0xe8b7('0xe'),auth[_0xe8b7('0x9')](),controller[_0xe8b7('0xf')]);var upload=multer({'storage':multer[_0xe8b7('0x10')]({'destination':function(_0x38253a,_0x4ad1ea,_0x11fc87){_0x11fc87(null,path[_0xe8b7('0x11')](config[_0xe8b7('0x12')],_0xe8b7('0x13')));},'filename':function(_0x44fd68,_0x398da7,_0x4013b7){_0x398da7[_0xe8b7('0x14')]=_0x398da7[_0xe8b7('0x14')][_0xe8b7('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4013b7(null,util[_0xe8b7('0x16')](_0xe8b7('0x17'),path['basename'](_0x398da7[_0xe8b7('0x14')],path['extname'](_0x398da7[_0xe8b7('0x14')])),Date[_0xe8b7('0x18')](),path['extname'](_0x398da7[_0xe8b7('0x14')])));}})});router[_0xe8b7('0x19')]('/',upload[_0xe8b7('0x1a')](_0xe8b7('0x1b')),controller[_0xe8b7('0x1c')]);router['put'](_0xe8b7('0xc'),auth[_0xe8b7('0x9')](),controller[_0xe8b7('0x1d')]);router['delete'](_0xe8b7('0xc'),auth[_0xe8b7('0x9')](),controller[_0xe8b7('0x1e')]);module[_0xe8b7('0x1f')]=router;