Built motion from commit (unavailable).|2.5.15
[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 _0x21ab=['util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','show','/:id/download','isAuthenticated','download','post','/:id/clone','clone','diskStorage','join','root','server/files/attachments/','format','now','file','create','put','/:id','update','exports'];(function(_0x2fffb7,_0x3783e){var _0x5ecaf4=function(_0x46d9a2){while(--_0x46d9a2){_0x2fffb7['push'](_0x2fffb7['shift']());}};_0x5ecaf4(++_0x3783e);}(_0x21ab,0x16c));var _0xb21a=function(_0x124728,_0x463dca){_0x124728=_0x124728-0x0;var _0x8eb20f=_0x21ab[_0x124728];return _0x8eb20f;};'use strict';var multer=require('multer');var util=require(_0xb21a('0x0'));var path=require('path');var timeout=require(_0xb21a('0x1'));var express=require(_0xb21a('0x2'));var router=express[_0xb21a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb21a('0x4'));var config=require(_0xb21a('0x5'));var controller=require(_0xb21a('0x6'));router[_0xb21a('0x7')]('/',auth['isAuthenticated'](),controller[_0xb21a('0x8')]);router[_0xb21a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb21a('0x9')]);router['get'](_0xb21a('0xa'),auth[_0xb21a('0xb')](),controller[_0xb21a('0xc')]);router[_0xb21a('0xd')](_0xb21a('0xe'),auth[_0xb21a('0xb')](),controller[_0xb21a('0xf')]);var upload=multer({'storage':multer[_0xb21a('0x10')]({'destination':function(_0x139ce7,_0x3bec53,_0x2da0f8){_0x2da0f8(null,path[_0xb21a('0x11')](config[_0xb21a('0x12')],_0xb21a('0x13')));},'filename':function(_0x486620,_0x50af1d,_0x509c98){_0x509c98(null,util[_0xb21a('0x14')]('%s-%s',Date[_0xb21a('0x15')](),_0x50af1d['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb21a('0xd')]('/',upload['single'](_0xb21a('0x16')),controller[_0xb21a('0x17')]);router[_0xb21a('0x18')](_0xb21a('0x19'),auth[_0xb21a('0xb')](),controller[_0xb21a('0x1a')]);router['delete'](_0xb21a('0x19'),auth[_0xb21a('0xb')](),controller['destroy']);module[_0xb21a('0x1b')]=router;