Built motion from commit (unavailable).|2.5.6
[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 _0x4d1b=['download','post','/:id/clone','clone','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','create','put','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./attachment.controller','get','index','/:id','isAuthenticated','/:id/download'];(function(_0x51168c,_0x2dc073){var _0x5d58f8=function(_0x4d4eaa){while(--_0x4d4eaa){_0x51168c['push'](_0x51168c['shift']());}};_0x5d58f8(++_0x2dc073);}(_0x4d1b,0x102));var _0xb4d1=function(_0x59b2a1,_0x1f631f){_0x59b2a1=_0x59b2a1-0x0;var _0x4908d1=_0x4d1b[_0x59b2a1];return _0x4908d1;};'use strict';var multer=require(_0xb4d1('0x0'));var util=require('util');var path=require(_0xb4d1('0x1'));var timeout=require(_0xb4d1('0x2'));var express=require(_0xb4d1('0x3'));var router=express[_0xb4d1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb4d1('0x5'));var config=require('../../config/environment');var controller=require(_0xb4d1('0x6'));router[_0xb4d1('0x7')]('/',auth['isAuthenticated'](),controller[_0xb4d1('0x8')]);router[_0xb4d1('0x7')](_0xb4d1('0x9'),auth[_0xb4d1('0xa')](),controller['show']);router[_0xb4d1('0x7')](_0xb4d1('0xb'),auth['isAuthenticated'](),controller[_0xb4d1('0xc')]);router[_0xb4d1('0xd')](_0xb4d1('0xe'),auth[_0xb4d1('0xa')](),controller[_0xb4d1('0xf')]);var upload=multer({'storage':multer[_0xb4d1('0x10')]({'destination':function(_0x57458f,_0x42e5a8,_0x320b9a){_0x320b9a(null,path[_0xb4d1('0x11')](config[_0xb4d1('0x12')],_0xb4d1('0x13')));},'filename':function(_0x3695b4,_0x2d24ec,_0x77771c){_0x77771c(null,util[_0xb4d1('0x14')](_0xb4d1('0x15'),Date[_0xb4d1('0x16')](),_0x2d24ec[_0xb4d1('0x17')][_0xb4d1('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb4d1('0xd')]('/',upload[_0xb4d1('0x19')](_0xb4d1('0x1a')),controller[_0xb4d1('0x1b')]);router[_0xb4d1('0x1c')](_0xb4d1('0x9'),auth[_0xb4d1('0xa')](),controller['update']);router['delete'](_0xb4d1('0x9'),auth[_0xb4d1('0xa')](),controller['destroy']);module[_0xb4d1('0x1d')]=router;