Built motion from commit (unavailable).|2.5.11
[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 _0xc3b7=['isAuthenticated','/:id/download','download','post','/:id/clone','clone','diskStorage','join','root','format','%s-%s','now','replace','single','file','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','index','get','/:id'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc3b7,0xb4));var _0x7c3b=function(_0x5463c7,_0x143458){_0x5463c7=_0x5463c7-0x0;var _0x2340c1=_0xc3b7[_0x5463c7];return _0x2340c1;};'use strict';var multer=require('multer');var util=require(_0x7c3b('0x0'));var path=require(_0x7c3b('0x1'));var timeout=require(_0x7c3b('0x2'));var express=require(_0x7c3b('0x3'));var router=express[_0x7c3b('0x4')]();var auth=require(_0x7c3b('0x5'));var interaction=require(_0x7c3b('0x6'));var config=require(_0x7c3b('0x7'));var controller=require(_0x7c3b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7c3b('0x9')]);router[_0x7c3b('0xa')](_0x7c3b('0xb'),auth[_0x7c3b('0xc')](),controller['show']);router[_0x7c3b('0xa')](_0x7c3b('0xd'),auth[_0x7c3b('0xc')](),controller[_0x7c3b('0xe')]);router[_0x7c3b('0xf')](_0x7c3b('0x10'),auth[_0x7c3b('0xc')](),controller[_0x7c3b('0x11')]);var upload=multer({'storage':multer[_0x7c3b('0x12')]({'destination':function(_0x220f21,_0x74dc35,_0xf4883f){_0xf4883f(null,path[_0x7c3b('0x13')](config[_0x7c3b('0x14')],'server/files/attachments/'));},'filename':function(_0x157e55,_0x455145,_0x4c7871){_0x4c7871(null,util[_0x7c3b('0x15')](_0x7c3b('0x16'),Date[_0x7c3b('0x17')](),_0x455145['originalname'][_0x7c3b('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7c3b('0xf')]('/',upload[_0x7c3b('0x19')](_0x7c3b('0x1a')),controller['create']);router[_0x7c3b('0x1b')](_0x7c3b('0xb'),auth['isAuthenticated'](),controller[_0x7c3b('0x1c')]);router[_0x7c3b('0x1d')](_0x7c3b('0xb'),auth[_0x7c3b('0xc')](),controller[_0x7c3b('0x1e')]);module[_0x7c3b('0x1f')]=router;