Built motion from commit (unavailable).|2.5.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 _0xfef9=['/:id/clone','clone','join','root','server/files/attachments/','format','%s-%s','originalname','replace','single','file','put','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','post'];(function(_0x518ff9,_0x3c3648){var _0x470dc5=function(_0x569a21){while(--_0x569a21){_0x518ff9['push'](_0x518ff9['shift']());}};_0x470dc5(++_0x3c3648);}(_0xfef9,0xd3));var _0x9fef=function(_0xf20b6,_0x49ddbb){_0xf20b6=_0xf20b6-0x0;var _0x4ff567=_0xfef9[_0xf20b6];return _0x4ff567;};'use strict';var multer=require(_0x9fef('0x0'));var util=require(_0x9fef('0x1'));var path=require('path');var timeout=require(_0x9fef('0x2'));var express=require(_0x9fef('0x3'));var router=express['Router']();var auth=require(_0x9fef('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9fef('0x5'));var controller=require('./attachment.controller');router[_0x9fef('0x6')]('/',auth[_0x9fef('0x7')](),controller['index']);router[_0x9fef('0x6')](_0x9fef('0x8'),auth['isAuthenticated'](),controller[_0x9fef('0x9')]);router[_0x9fef('0x6')](_0x9fef('0xa'),auth['isAuthenticated'](),controller[_0x9fef('0xb')]);router[_0x9fef('0xc')](_0x9fef('0xd'),auth['isAuthenticated'](),controller[_0x9fef('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c7241,_0x34442f,_0x2ff18e){_0x2ff18e(null,path[_0x9fef('0xf')](config[_0x9fef('0x10')],_0x9fef('0x11')));},'filename':function(_0xfd9eec,_0x5ba68a,_0x37640b){_0x37640b(null,util[_0x9fef('0x12')](_0x9fef('0x13'),Date['now'](),_0x5ba68a[_0x9fef('0x14')][_0x9fef('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9fef('0xc')]('/',upload[_0x9fef('0x16')](_0x9fef('0x17')),controller['create']);router[_0x9fef('0x18')]('/:id',auth[_0x9fef('0x7')](),controller['update']);router[_0x9fef('0x19')](_0x9fef('0x8'),auth[_0x9fef('0x7')](),controller[_0x9fef('0x1a')]);module[_0x9fef('0x1b')]=router;