Built motion from commit (unavailable).|2.3.1
[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 _0x6c6f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','/:id/download','download','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post','single','file','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x23bc85,_0x19addc){var _0x177dfd=function(_0x134ab5){while(--_0x134ab5){_0x23bc85['push'](_0x23bc85['shift']());}};_0x177dfd(++_0x19addc);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x3803ab,_0x348842){_0x3803ab=_0x3803ab-0x0;var _0x3637d0=_0x6c6f[_0x3803ab];return _0x3637d0;};'use strict';var multer=require(_0xf6c6('0x0'));var util=require(_0xf6c6('0x1'));var path=require(_0xf6c6('0x2'));var timeout=require(_0xf6c6('0x3'));var express=require(_0xf6c6('0x4'));var router=express[_0xf6c6('0x5')]();var auth=require(_0xf6c6('0x6'));var interaction=require(_0xf6c6('0x7'));var config=require(_0xf6c6('0x8'));var controller=require(_0xf6c6('0x9'));router[_0xf6c6('0xa')]('/',auth['isAuthenticated'](),controller[_0xf6c6('0xb')]);router['get']('/:id',auth[_0xf6c6('0xc')](),controller['show']);router[_0xf6c6('0xa')](_0xf6c6('0xd'),auth[_0xf6c6('0xc')](),controller[_0xf6c6('0xe')]);var upload=multer({'storage':multer[_0xf6c6('0xf')]({'destination':function(_0x4d2413,_0x19a91f,_0x2ff1c1){_0x2ff1c1(null,path['join'](config[_0xf6c6('0x10')],_0xf6c6('0x11')));},'filename':function(_0x278f23,_0x4e34e5,_0x42338f){_0x42338f(null,util[_0xf6c6('0x12')](_0xf6c6('0x13'),Date[_0xf6c6('0x14')](),_0x4e34e5[_0xf6c6('0x15')][_0xf6c6('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf6c6('0x17')]('/',upload[_0xf6c6('0x18')](_0xf6c6('0x19')),controller[_0xf6c6('0x1a')]);router['put'](_0xf6c6('0x1b'),auth[_0xf6c6('0xc')](),controller[_0xf6c6('0x1c')]);router[_0xf6c6('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xf6c6('0x1e')]);module[_0xf6c6('0x1f')]=router;