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 _0x8cda=['../../components/auth/service','../../config/environment','./attachment.controller','get','index','/:id','isAuthenticated','show','/:id/download','diskStorage','join','format','%s-%s','originalname','post','file','put','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0x8cda,0x1db));var _0xa8cd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8cda[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xa8cd('0x0'));var path=require(_0xa8cd('0x1'));var timeout=require(_0xa8cd('0x2'));var express=require(_0xa8cd('0x3'));var router=express[_0xa8cd('0x4')]();var auth=require(_0xa8cd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa8cd('0x6'));var controller=require(_0xa8cd('0x7'));router[_0xa8cd('0x8')]('/',auth['isAuthenticated'](),controller[_0xa8cd('0x9')]);router[_0xa8cd('0x8')](_0xa8cd('0xa'),auth[_0xa8cd('0xb')](),controller[_0xa8cd('0xc')]);router[_0xa8cd('0x8')](_0xa8cd('0xd'),auth[_0xa8cd('0xb')](),controller['download']);router['post']('/:id/clone',auth[_0xa8cd('0xb')](),controller['clone']);var upload=multer({'storage':multer[_0xa8cd('0xe')]({'destination':function(_0x3e6bed,_0x4ae00e,_0x8ee1a5){_0x8ee1a5(null,path[_0xa8cd('0xf')](config['root'],'server/files/attachments/'));},'filename':function(_0xec5e4,_0xa2b804,_0x19ba69){_0x19ba69(null,util[_0xa8cd('0x10')](_0xa8cd('0x11'),Date['now'](),_0xa2b804[_0xa8cd('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa8cd('0x13')]('/',upload['single'](_0xa8cd('0x14')),controller['create']);router[_0xa8cd('0x15')](_0xa8cd('0xa'),auth[_0xa8cd('0xb')](),controller['update']);router['delete'](_0xa8cd('0xa'),auth[_0xa8cd('0xb')](),controller[_0xa8cd('0x16')]);module[_0xa8cd('0x17')]=router;