Built motion from commit (unavailable).|2.4.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 _0xc17f=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','/:id','isAuthenticated','show','/:id/download','diskStorage','server/files/attachments/','format','%s-%s','now','originalname','replace','post','file','create','put'];(function(_0x54bafd,_0x3d73f8){var _0x24b2c3=function(_0x404594){while(--_0x404594){_0x54bafd['push'](_0x54bafd['shift']());}};_0x24b2c3(++_0x3d73f8);}(_0xc17f,0xb8));var _0xfc17=function(_0x1732f3,_0x38c1b4){_0x1732f3=_0x1732f3-0x0;var _0x37354e=_0xc17f[_0x1732f3];return _0x37354e;};'use strict';var multer=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var path=require(_0xfc17('0x2'));var timeout=require(_0xfc17('0x3'));var express=require(_0xfc17('0x4'));var router=express[_0xfc17('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xfc17('0x6'));var config=require(_0xfc17('0x7'));var controller=require(_0xfc17('0x8'));router[_0xfc17('0x9')]('/',auth['isAuthenticated'](),controller[_0xfc17('0xa')]);router[_0xfc17('0x9')](_0xfc17('0xb'),auth[_0xfc17('0xc')](),controller[_0xfc17('0xd')]);router[_0xfc17('0x9')](_0xfc17('0xe'),auth[_0xfc17('0xc')](),controller['download']);var upload=multer({'storage':multer[_0xfc17('0xf')]({'destination':function(_0x1d43ee,_0x343eff,_0x2e722){_0x2e722(null,path['join'](config['root'],_0xfc17('0x10')));},'filename':function(_0x22cbef,_0x2924e9,_0x431f67){_0x431f67(null,util[_0xfc17('0x11')](_0xfc17('0x12'),Date[_0xfc17('0x13')](),_0x2924e9[_0xfc17('0x14')][_0xfc17('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xfc17('0x16')]('/',upload['single'](_0xfc17('0x17')),controller[_0xfc17('0x18')]);router[_0xfc17('0x19')]('/:id',auth[_0xfc17('0xc')](),controller[_0xfc17('0x1a')]);router[_0xfc17('0x1b')](_0xfc17('0xb'),auth[_0xfc17('0xc')](),controller[_0xfc17('0x1c')]);module[_0xfc17('0x1d')]=router;