Built motion from commit (unavailable).|2.5.21
[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 _0x6dc0=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./attachment.controller','get','index','/:id','isAuthenticated','show','/:id/download','/:id/clone','diskStorage','root','server/files/attachments/','%s-%s','post','single','file','put','update','destroy','exports'];(function(_0x56ccc0,_0x3e48e1){var _0x261b2b=function(_0x1eebc9){while(--_0x1eebc9){_0x56ccc0['push'](_0x56ccc0['shift']());}};_0x261b2b(++_0x3e48e1);}(_0x6dc0,0xb6));var _0x06dc=function(_0x3b44b3,_0x5a0b8b){_0x3b44b3=_0x3b44b3-0x0;var _0x1be07c=_0x6dc0[_0x3b44b3];return _0x1be07c;};'use strict';var multer=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var path=require(_0x06dc('0x2'));var timeout=require('connect-timeout');var express=require(_0x06dc('0x3'));var router=express[_0x06dc('0x4')]();var auth=require(_0x06dc('0x5'));var interaction=require(_0x06dc('0x6'));var config=require('../../config/environment');var controller=require(_0x06dc('0x7'));router[_0x06dc('0x8')]('/',auth['isAuthenticated'](),controller[_0x06dc('0x9')]);router['get'](_0x06dc('0xa'),auth[_0x06dc('0xb')](),controller[_0x06dc('0xc')]);router[_0x06dc('0x8')](_0x06dc('0xd'),auth['isAuthenticated'](),controller['download']);router['post'](_0x06dc('0xe'),auth[_0x06dc('0xb')](),controller['clone']);var upload=multer({'storage':multer[_0x06dc('0xf')]({'destination':function(_0x1e7abd,_0x1a8abe,_0x46491a){_0x46491a(null,path['join'](config[_0x06dc('0x10')],_0x06dc('0x11')));},'filename':function(_0x497937,_0x527806,_0x534c07){_0x534c07(null,util['format'](_0x06dc('0x12'),Date['now'](),_0x527806['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x06dc('0x13')]('/',upload[_0x06dc('0x14')](_0x06dc('0x15')),controller['create']);router[_0x06dc('0x16')](_0x06dc('0xa'),auth[_0x06dc('0xb')](),controller[_0x06dc('0x17')]);router['delete'](_0x06dc('0xa'),auth[_0x06dc('0xb')](),controller[_0x06dc('0x18')]);module[_0x06dc('0x19')]=router;