1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x390a=['destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','post','/:id/clone','diskStorage','join','root','%s-%s','now','replace','create','delete'];(function(_0x3fe08f,_0x4ab686){var _0x583610=function(_0x354a72){while(--_0x354a72){_0x3fe08f['push'](_0x3fe08f['shift']());}};_0x583610(++_0x4ab686);}(_0x390a,0xc9));var _0xa390=function(_0x4e1785,_0x2ff29e){_0x4e1785=_0x4e1785-0x0;var _0x15a274=_0x390a[_0x4e1785];return _0x15a274;};'use strict';var multer=require(_0xa390('0x0'));var util=require(_0xa390('0x1'));var path=require(_0xa390('0x2'));var timeout=require(_0xa390('0x3'));var express=require('express');var router=express[_0xa390('0x4')]();var auth=require(_0xa390('0x5'));var interaction=require(_0xa390('0x6'));var config=require(_0xa390('0x7'));var controller=require('./attachment.controller');router[_0xa390('0x8')]('/',auth[_0xa390('0x9')](),controller[_0xa390('0xa')]);router['get'](_0xa390('0xb'),auth[_0xa390('0x9')](),controller['show']);router['get'](_0xa390('0xc'),auth[_0xa390('0x9')](),controller[_0xa390('0xd')]);router[_0xa390('0xe')](_0xa390('0xf'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xa390('0x10')]({'destination':function(_0x34f0fe,_0x1ecd8b,_0x484b38){_0x484b38(null,path[_0xa390('0x11')](config[_0xa390('0x12')],'server/files/attachments/'));},'filename':function(_0x8580d5,_0x2bee3b,_0x57a89a){_0x57a89a(null,util['format'](_0xa390('0x13'),Date[_0xa390('0x14')](),_0x2bee3b['originalname'][_0xa390('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload['single']('file'),controller[_0xa390('0x16')]);router['put'](_0xa390('0xb'),auth[_0xa390('0x9')](),controller['update']);router[_0xa390('0x17')](_0xa390('0xb'),auth['isAuthenticated'](),controller[_0xa390('0x18')]);module['exports']=router;