Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / attachment / index.js
index ebc8bbb..e669ecc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fce=['multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','clone','diskStorage','join','now','originalname','replace','single','create','update','delete'];(function(_0x1c12fa,_0x2cfc4f){var _0x2f4e4b=function(_0x4ccc20){while(--_0x4ccc20){_0x1c12fa['push'](_0x1c12fa['shift']());}};_0x2f4e4b(++_0x2cfc4f);}(_0x7fce,0xdc));var _0xe7fc=function(_0x118389,_0xf610c1){_0x118389=_0x118389-0x0;var _0x412b5f=_0x7fce[_0x118389];return _0x412b5f;};'use strict';var multer=require(_0xe7fc('0x0'));var util=require(_0xe7fc('0x1'));var path=require(_0xe7fc('0x2'));var timeout=require('connect-timeout');var express=require(_0xe7fc('0x3'));var router=express['Router']();var fs_extra=require(_0xe7fc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe7fc('0x5'));var config=require(_0xe7fc('0x6'));var controller=require('./attachment.controller');router['get']('/',auth[_0xe7fc('0x7')](),controller['index']);router[_0xe7fc('0x8')](_0xe7fc('0x9'),auth[_0xe7fc('0x7')](),controller[_0xe7fc('0xa')]);router[_0xe7fc('0x8')]('/:id/download',auth[_0xe7fc('0x7')](),controller['download']);router[_0xe7fc('0xb')]('/:id/clone',auth[_0xe7fc('0x7')](),controller[_0xe7fc('0xc')]);var upload=multer({'storage':multer[_0xe7fc('0xd')]({'destination':function(_0x31c05f,_0x53a26c,_0x278e9a){_0x278e9a(null,path[_0xe7fc('0xe')](config['root'],'server/files/attachments/'));},'filename':function(_0x243600,_0x59da2e,_0x38512a){_0x38512a(null,util['format']('%s-%s',Date[_0xe7fc('0xf')](),_0x59da2e[_0xe7fc('0x10')][_0xe7fc('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe7fc('0xb')]('/',upload[_0xe7fc('0x12')]('file'),controller[_0xe7fc('0x13')]);router['put']('/:id',auth[_0xe7fc('0x7')](),controller[_0xe7fc('0x14')]);router[_0xe7fc('0x15')](_0xe7fc('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file