Built motion from commit a9fb64cc6defd8fb3a5cc199221f878e91c0e969. Version 3.0.0...
[motion-next.git] / server / api / attachment / index.js
1 const a32_0x3b64=['replace','single','download','path','show','%s-%s','file','post','get','../../components/auth/service','Router','now','isAuthenticated','../../config/environment','destroy','multer','express','util','/:id','delete','/:id/clone','originalname','diskStorage'];(function(_0x1c803d,_0x3b6457){const _0x26e6a0=function(_0x7460d4){while(--_0x7460d4){_0x1c803d['push'](_0x1c803d['shift']());}};_0x26e6a0(++_0x3b6457);}(a32_0x3b64,0xb0));const a32_0x26e6=function(_0x1c803d,_0x3b6457){_0x1c803d=_0x1c803d-0x0;let _0x26e6a0=a32_0x3b64[_0x1c803d];return _0x26e6a0;};const _0x53bb09=a32_0x26e6;'use strict';const multer=require(_0x53bb09('0x0')),util=require(_0x53bb09('0x2')),path=require(_0x53bb09('0xb')),express=require(_0x53bb09('0x1')),router=express[_0x53bb09('0x12')](),auth=require(_0x53bb09('0x11')),config=require(_0x53bb09('0x15')),controller=require('./attachment.controller');router[_0x53bb09('0x10')]('/',auth[_0x53bb09('0x14')](),controller['index']),router[_0x53bb09('0x10')](_0x53bb09('0x3'),auth[_0x53bb09('0x14')](),controller[_0x53bb09('0xc')]),router[_0x53bb09('0x10')]('/:id/download',auth['isAuthenticated'](),controller[_0x53bb09('0xa')]),router[_0x53bb09('0xf')](_0x53bb09('0x5'),auth['isAuthenticated'](),controller['clone']);const upload=multer({'storage':multer[_0x53bb09('0x7')]({'destination':function(_0x7460d4,_0x3546b2,_0x555367){_0x555367(null,path['join'](config['root'],'files/attachments/'));},'filename':function(_0x5e1958,_0x4449e9,_0x3ba5cb){const _0x13e4e8=_0x53bb09;_0x3ba5cb(null,util['format'](_0x13e4e8('0xd'),Date[_0x13e4e8('0x13')](),_0x4449e9[_0x13e4e8('0x6')][_0x13e4e8('0x8')](/[+@&/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x53bb09('0xf')]('/',upload[_0x53bb09('0x9')](_0x53bb09('0xe')),controller['create']),router['put'](_0x53bb09('0x3'),auth[_0x53bb09('0x14')](),controller['update']),router[_0x53bb09('0x4')](_0x53bb09('0x3'),auth[_0x53bb09('0x14')](),controller[_0x53bb09('0x16')]),module['exports']=router;