Built motion from commit (unavailable).|2.4.20
[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 _0x9e38=['%s-%s','now','originalname','replace','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone','diskStorage','root','server/files/attachments/'];(function(_0x1a87b3,_0x45ba68){var _0x37e84d=function(_0x39f49e){while(--_0x39f49e){_0x1a87b3['push'](_0x1a87b3['shift']());}};_0x37e84d(++_0x45ba68);}(_0x9e38,0x155));var _0x89e3=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x9e38[_0x30033a];return _0x5e3518;};'use strict';var multer=require(_0x89e3('0x0'));var util=require(_0x89e3('0x1'));var path=require(_0x89e3('0x2'));var timeout=require(_0x89e3('0x3'));var express=require(_0x89e3('0x4'));var router=express[_0x89e3('0x5')]();var auth=require(_0x89e3('0x6'));var interaction=require(_0x89e3('0x7'));var config=require(_0x89e3('0x8'));var controller=require(_0x89e3('0x9'));router[_0x89e3('0xa')]('/',auth[_0x89e3('0xb')](),controller[_0x89e3('0xc')]);router['get'](_0x89e3('0xd'),auth[_0x89e3('0xb')](),controller[_0x89e3('0xe')]);router[_0x89e3('0xa')](_0x89e3('0xf'),auth[_0x89e3('0xb')](),controller[_0x89e3('0x10')]);router[_0x89e3('0x11')](_0x89e3('0x12'),auth[_0x89e3('0xb')](),controller['clone']);var upload=multer({'storage':multer[_0x89e3('0x13')]({'destination':function(_0x47b93,_0x4c8f52,_0x24b826){_0x24b826(null,path['join'](config[_0x89e3('0x14')],_0x89e3('0x15')));},'filename':function(_0x1c1d82,_0x4b1b74,_0x1d84c5){_0x1d84c5(null,util['format'](_0x89e3('0x16'),Date[_0x89e3('0x17')](),_0x4b1b74[_0x89e3('0x18')][_0x89e3('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x89e3('0x11')]('/',upload[_0x89e3('0x1a')](_0x89e3('0x1b')),controller[_0x89e3('0x1c')]);router[_0x89e3('0x1d')](_0x89e3('0xd'),auth[_0x89e3('0xb')](),controller[_0x89e3('0x1e')]);router[_0x89e3('0x1f')](_0x89e3('0xd'),auth[_0x89e3('0xb')](),controller['destroy']);module[_0x89e3('0x20')]=router;