Built motion from commit (unavailable).|2.4.4
[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 _0x453b=['replace','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','/:id/download','download','join','server/files/attachments/','format','%s-%s','now','originalname'];(function(_0x1bf8f5,_0x28f62c){var _0x36a54e=function(_0x43ba61){while(--_0x43ba61){_0x1bf8f5['push'](_0x1bf8f5['shift']());}};_0x36a54e(++_0x28f62c);}(_0x453b,0x164));var _0xb453=function(_0x264b61,_0x4a5017){_0x264b61=_0x264b61-0x0;var _0x8fff4f=_0x453b[_0x264b61];return _0x8fff4f;};'use strict';var multer=require(_0xb453('0x0'));var util=require(_0xb453('0x1'));var path=require(_0xb453('0x2'));var timeout=require(_0xb453('0x3'));var express=require(_0xb453('0x4'));var router=express[_0xb453('0x5')]();var auth=require(_0xb453('0x6'));var interaction=require(_0xb453('0x7'));var config=require(_0xb453('0x8'));var controller=require(_0xb453('0x9'));router[_0xb453('0xa')]('/',auth[_0xb453('0xb')](),controller[_0xb453('0xc')]);router[_0xb453('0xa')](_0xb453('0xd'),auth[_0xb453('0xb')](),controller['show']);router[_0xb453('0xa')](_0xb453('0xe'),auth['isAuthenticated'](),controller[_0xb453('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x894303,_0x2aa50b,_0x446cd3){_0x446cd3(null,path[_0xb453('0x10')](config['root'],_0xb453('0x11')));},'filename':function(_0x3a396f,_0x1ac734,_0x35433d){_0x35433d(null,util[_0xb453('0x12')](_0xb453('0x13'),Date[_0xb453('0x14')](),_0x1ac734[_0xb453('0x15')][_0xb453('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload['single']('file'),controller[_0xb453('0x17')]);router['put'](_0xb453('0xd'),auth[_0xb453('0xb')](),controller[_0xb453('0x18')]);router['delete']('/:id',auth[_0xb453('0xb')](),controller[_0xb453('0x19')]);module[_0xb453('0x1a')]=router;