Built motion from commit (unavailable).|2.4.21
[motion2.git] / server / api / attachment / 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 _0x6aa4=['put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','/:id/clone','clone','diskStorage','join','root','format','replace','file','create'];(function(_0x5c6be5,_0x3ff1d5){var _0x151348=function(_0x3df6c6){while(--_0x3df6c6){_0x5c6be5['push'](_0x5c6be5['shift']());}};_0x151348(++_0x3ff1d5);}(_0x6aa4,0xb2));var _0x46aa=function(_0x2a96ff,_0x558504){_0x2a96ff=_0x2a96ff-0x0;var _0x142175=_0x6aa4[_0x2a96ff];return _0x142175;};'use strict';var multer=require(_0x46aa('0x0'));var util=require(_0x46aa('0x1'));var path=require(_0x46aa('0x2'));var timeout=require('connect-timeout');var express=require(_0x46aa('0x3'));var router=express[_0x46aa('0x4')]();var auth=require(_0x46aa('0x5'));var interaction=require(_0x46aa('0x6'));var config=require(_0x46aa('0x7'));var controller=require(_0x46aa('0x8'));router[_0x46aa('0x9')]('/',auth[_0x46aa('0xa')](),controller[_0x46aa('0xb')]);router[_0x46aa('0x9')](_0x46aa('0xc'),auth[_0x46aa('0xa')](),controller['show']);router[_0x46aa('0x9')](_0x46aa('0xd'),auth[_0x46aa('0xa')](),controller[_0x46aa('0xe')]);router[_0x46aa('0xf')](_0x46aa('0x10'),auth['isAuthenticated'](),controller[_0x46aa('0x11')]);var upload=multer({'storage':multer[_0x46aa('0x12')]({'destination':function(_0x5a82d5,_0x13db49,_0x474c2e){_0x474c2e(null,path[_0x46aa('0x13')](config[_0x46aa('0x14')],'server/files/attachments/'));},'filename':function(_0x31a0e3,_0x5f1237,_0x6a73c1){_0x6a73c1(null,util[_0x46aa('0x15')]('%s-%s',Date['now'](),_0x5f1237['originalname'][_0x46aa('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x46aa('0xf')]('/',upload['single'](_0x46aa('0x17')),controller[_0x46aa('0x18')]);router[_0x46aa('0x19')](_0x46aa('0xc'),auth[_0x46aa('0xa')](),controller[_0x46aa('0x1a')]);router[_0x46aa('0x1b')](_0x46aa('0xc'),auth['isAuthenticated'](),controller[_0x46aa('0x1c')]);module['exports']=router;