Built motion from commit (unavailable).|2.4.18
[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 _0x0e21=['/:id/download','download','clone','diskStorage','join','root','server/files/attachments/','format','post','single','file','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x55af0f,_0x1bba80){var _0x1ff172=function(_0x3d150e){while(--_0x3d150e){_0x55af0f['push'](_0x55af0f['shift']());}};_0x1ff172(++_0x1bba80);}(_0x0e21,0xe8));var _0x10e2=function(_0x3418fb,_0x3ba0ae){_0x3418fb=_0x3418fb-0x0;var _0xbea12e=_0x0e21[_0x3418fb];return _0xbea12e;};'use strict';var multer=require('multer');var util=require(_0x10e2('0x0'));var path=require(_0x10e2('0x1'));var timeout=require(_0x10e2('0x2'));var express=require('express');var router=express[_0x10e2('0x3')]();var auth=require(_0x10e2('0x4'));var interaction=require(_0x10e2('0x5'));var config=require('../../config/environment');var controller=require('./attachment.controller');router[_0x10e2('0x6')]('/',auth[_0x10e2('0x7')](),controller[_0x10e2('0x8')]);router[_0x10e2('0x6')](_0x10e2('0x9'),auth[_0x10e2('0x7')](),controller[_0x10e2('0xa')]);router[_0x10e2('0x6')](_0x10e2('0xb'),auth['isAuthenticated'](),controller[_0x10e2('0xc')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x10e2('0xd')]);var upload=multer({'storage':multer[_0x10e2('0xe')]({'destination':function(_0x5c6925,_0x2f7131,_0x530522){_0x530522(null,path[_0x10e2('0xf')](config[_0x10e2('0x10')],_0x10e2('0x11')));},'filename':function(_0x56db90,_0x37dafd,_0x4072f4){_0x4072f4(null,util[_0x10e2('0x12')]('%s-%s',Date['now'](),_0x37dafd['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x10e2('0x13')]('/',upload[_0x10e2('0x14')](_0x10e2('0x15')),controller['create']);router[_0x10e2('0x16')](_0x10e2('0x9'),auth[_0x10e2('0x7')](),controller[_0x10e2('0x17')]);router[_0x10e2('0x18')](_0x10e2('0x9'),auth['isAuthenticated'](),controller[_0x10e2('0x19')]);module[_0x10e2('0x1a')]=router;