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 _0xbdbe=['get','index','/:id','isAuthenticated','show','/:id/download','download','post','/:id/clone','clone','diskStorage','join','root','format','%s-%s','originalname','replace','single','file','create','put','update','exports','multer','path','express','../../components/auth/service','../../config/environment'];(function(_0x58db01,_0xd7477d){var _0x35710c=function(_0x517ebf){while(--_0x517ebf){_0x58db01['push'](_0x58db01['shift']());}};_0x35710c(++_0xd7477d);}(_0xbdbe,0x1f3));var _0xebdb=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xbdbe[_0x29d94e];return _0x106237;};'use strict';var multer=require(_0xebdb('0x0'));var util=require('util');var path=require(_0xebdb('0x1'));var timeout=require('connect-timeout');var express=require(_0xebdb('0x2'));var router=express['Router']();var auth=require(_0xebdb('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xebdb('0x4'));var controller=require('./attachment.controller');router[_0xebdb('0x5')]('/',auth['isAuthenticated'](),controller[_0xebdb('0x6')]);router[_0xebdb('0x5')](_0xebdb('0x7'),auth[_0xebdb('0x8')](),controller[_0xebdb('0x9')]);router[_0xebdb('0x5')](_0xebdb('0xa'),auth[_0xebdb('0x8')](),controller[_0xebdb('0xb')]);router[_0xebdb('0xc')](_0xebdb('0xd'),auth['isAuthenticated'](),controller[_0xebdb('0xe')]);var upload=multer({'storage':multer[_0xebdb('0xf')]({'destination':function(_0x557d85,_0x1f10d7,_0x24266c){_0x24266c(null,path[_0xebdb('0x10')](config[_0xebdb('0x11')],'server/files/attachments/'));},'filename':function(_0x5cdcb5,_0xb4bc79,_0x3e0a6d){_0x3e0a6d(null,util[_0xebdb('0x12')](_0xebdb('0x13'),Date['now'](),_0xb4bc79[_0xebdb('0x14')][_0xebdb('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xebdb('0xc')]('/',upload[_0xebdb('0x16')](_0xebdb('0x17')),controller[_0xebdb('0x18')]);router[_0xebdb('0x19')](_0xebdb('0x7'),auth[_0xebdb('0x8')](),controller[_0xebdb('0x1a')]);router['delete'](_0xebdb('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xebdb('0x1b')]=router;