Built motion from commit (unavailable).|2.5.29
[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 _0x4ded=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','/:id','isAuthenticated','show','clone','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post','single','file','create','put','destroy','exports','multer'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x4ded,0x116));var _0xd4de=function(_0x52a83c,_0x39e0a6){_0x52a83c=_0x52a83c-0x0;var _0x23804f=_0x4ded[_0x52a83c];return _0x23804f;};'use strict';var multer=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var path=require(_0xd4de('0x2'));var timeout=require(_0xd4de('0x3'));var express=require(_0xd4de('0x4'));var router=express[_0xd4de('0x5')]();var fs_extra=require(_0xd4de('0x6'));var auth=require(_0xd4de('0x7'));var interaction=require(_0xd4de('0x8'));var config=require(_0xd4de('0x9'));var controller=require(_0xd4de('0xa'));router[_0xd4de('0xb')]('/',auth['isAuthenticated'](),controller[_0xd4de('0xc')]);router[_0xd4de('0xb')](_0xd4de('0xd'),auth[_0xd4de('0xe')](),controller[_0xd4de('0xf')]);router[_0xd4de('0xb')]('/:id/download',auth[_0xd4de('0xe')](),controller['download']);router['post']('/:id/clone',auth[_0xd4de('0xe')](),controller[_0xd4de('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5b6dc4,_0x4c9499,_0x29e265){_0x29e265(null,path['join'](config[_0xd4de('0x11')],_0xd4de('0x12')));},'filename':function(_0x104dad,_0x2aa09d,_0x3ffc72){_0x3ffc72(null,util[_0xd4de('0x13')](_0xd4de('0x14'),Date[_0xd4de('0x15')](),_0x2aa09d[_0xd4de('0x16')][_0xd4de('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd4de('0x18')]('/',upload[_0xd4de('0x19')](_0xd4de('0x1a')),controller[_0xd4de('0x1b')]);router[_0xd4de('0x1c')](_0xd4de('0xd'),auth[_0xd4de('0xe')](),controller['update']);router['delete'](_0xd4de('0xd'),auth[_0xd4de('0xe')](),controller[_0xd4de('0x1d')]);module[_0xd4de('0x1e')]=router;