Built motion from commit 775e2a94.|2.6.3
[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 _0x3af1=['basename','extname','now','file','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s'];(function(_0x2cb82c,_0x2e6e7a){var _0x183a4e=function(_0x3e58eb){while(--_0x3e58eb){_0x2cb82c['push'](_0x2cb82c['shift']());}};_0x183a4e(++_0x2e6e7a);}(_0x3af1,0x69));var _0x13af=function(_0x41a40c,_0x37c8b1){_0x41a40c=_0x41a40c-0x0;var _0x87b056=_0x3af1[_0x41a40c];return _0x87b056;};'use strict';var multer=require('multer');var util=require(_0x13af('0x0'));var path=require(_0x13af('0x1'));var timeout=require(_0x13af('0x2'));var express=require(_0x13af('0x3'));var router=express[_0x13af('0x4')]();var fs_extra=require(_0x13af('0x5'));var auth=require(_0x13af('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x13af('0x7'));router[_0x13af('0x8')]('/',auth['isAuthenticated'](),controller[_0x13af('0x9')]);router['get'](_0x13af('0xa'),auth[_0x13af('0xb')](),controller[_0x13af('0xc')]);router['get'](_0x13af('0xd'),auth[_0x13af('0xb')](),controller[_0x13af('0xe')]);var upload=multer({'storage':multer[_0x13af('0xf')]({'destination':function(_0x454d1c,_0x490548,_0x858976){_0x858976(null,path[_0x13af('0x10')](config[_0x13af('0x11')],_0x13af('0x12')));},'filename':function(_0x546ee7,_0x3d511e,_0x15d503){_0x3d511e[_0x13af('0x13')]=_0x3d511e[_0x13af('0x13')][_0x13af('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x15d503(null,util[_0x13af('0x15')](_0x13af('0x16'),path[_0x13af('0x17')](_0x3d511e[_0x13af('0x13')],path[_0x13af('0x18')](_0x3d511e[_0x13af('0x13')])),Date[_0x13af('0x19')](),path[_0x13af('0x18')](_0x3d511e[_0x13af('0x13')])));}})});router['post']('/',upload['single'](_0x13af('0x1a')),controller[_0x13af('0x1b')]);router[_0x13af('0x1c')](_0x13af('0xa'),auth[_0x13af('0xb')](),controller[_0x13af('0x1d')]);router[_0x13af('0x1e')](_0x13af('0xa'),auth[_0x13af('0xb')](),controller['delete']);module[_0x13af('0x1f')]=router;