UNPKG

ithit.webdav.server

Version:

With IT Hit WebDAV Server Engine for Node.js you can create your own WebDAV server, add WebDAV support to your existing Node.js project or DAV-enable your CMS/DMS/CRM.

3 lines 12.9 kB
var a43_0x204d=['Li4vLi4vUHJvcGVydHlOYW1l','Li4vVXRpbC9IZWFkZXJVdGls','Li4vVXRpbC9NdWx0aXN0YXR1c1Jlc3BvbnNlV3JpdGVy','Li4vVXRpbC9PcmRlclByb3BlcnR5UmVhZGVy','Li4vVXRpbC9Qcm9wZXJ0eVJlYWRlcg==','Li4vVXRpbC9Qcm9wZXJ0eVdyaXRlcg==','Li4vV2ViZGF2Q29uc3RhbnRz','Li9CYXNlREFWSGFuZGxlcg==','QmFzZURhdkhhbmRsZXI=','d3JpdGVFbGVtZW50','d3JpdGVy','WG1sRWxlbWVudHM=','UkVTUE9OU0U=','d3JpdGVJdGVtSHJlZg==','c3RhcnRFbGVtZW50TlM=','UFJPUFNUQVQ=','d3JpdGVFbGVtZW50TlM=','SFRUUC8xLjEgMjAwIE9L','UFJPUA==','d3JpdGVQcm9wZXJ0eU5hbWVz','ZW5kRWxlbWVudA==','UHJvcGVydHlXcml0ZXI=','d3JpdGVQcm9wZXJpdGVz','ZW5naW5l','Z2V0UHJvcGVydHlOYW1lcw==','Z2V0UHJvcGVydGllc0Zvckl0ZW0=','bmFtZXNwYWNl','c3RhcnRFbGVtZW50','eG1sbnM=','YXBwbGllc1Rv','cHJvY2Vzc1JlcXVlc3Q=','SGVhZGVyVXRpbA==','RGF2U3RhdHVz','UFJFQ09ORElUSU9OX0ZBSUxFRA==','cmVxdWlyZUV4aXN0cw==','TXVsdGlzdGF0dXNSZXNwb25zZVdyaXRlcg==','Z2VuZXJhdGVQcm9wZmluZFJlc3BvbnNl','ZW1wdHlQcm9wTGlzdA==','cmVxdWVzdA==','Z2V0WG1sQ29udGVudA==','ZG9jdW1lbnRFbGVtZW50','UHJvcGVydHlSZWFkZXI=','cmVhZFByb3Bz','Z2V0RWxlbWVudHNCeVRhZ05hbWVOUw==','Q29uc3RhbnRz','REFW','QUxMUFJPUA==','bGVuZ3Ro','cmVhZEluY2x1ZGVQcm9wcw==','Z2V0QWxsUHJvcA==','aW5kZXhPZg==','c3BsaWNl','UFJPUE5BTUU=','aXNJUGFnaW5n','UHJvcGVydHlMaW1pdA==','TlJFU1VMVFM=','bm9kZVZhbHVl','T1JERVJCWQ==','T3JkZXJQcm9wZXJ0eVJlYWRlcg==','Z2V0RGVwdGg=','RGVwdGg=','WmVybw==','T25l','Zm9yRWFjaA==','cHVzaA==','UHJvcGVydHlOYW1l','UEFHSU5HX05BTUVTUEFDRQ==','dG9TdHJpbmc=','RGF2RW5naW5l','RGF2RXhjZXB0aW9u','RGVwdGguSW5maW5pdHkgZG9lcyBub3Qgc3VwcG9ydCBEOm9yZGVyYnku','ZW5kTXVsdGlTdGF0dXNSZXNwb25zZQ==','Z2V0UGFnZQ==','d3JpdGVFbGVtZW50UmVjdXJzaXZl','aW5zdGFuY2VPZklJdGVtQ29sbGVjdGlvbg==','Z2V0Q2hpbGRyZW4=','UHJvcGZpbmREYXZIYW5kbGVy','c3RyaW5n','Y29uc3RydWN0b3I=','d2hpbGUgKHRydWUpIHt9','Y291bnRlcg==','ZGVidQ==','Z2dlcg==','Y2FsbA==','YWN0aW9u','c3RhdGVPYmplY3Q=','YXBwbHk=','ZnVuY3Rpb24gKlwoICpcKQ==','aW5pdA==','dGVzdA==','aW5wdXQ=','ZGVmaW5lUHJvcGVydHk=','X19lc01vZHVsZQ==','Li4vLi4vRGF2RW5naW5l','Li4vLi4vRGF2RXhjZXB0aW9u','Li4vLi4vRGF2U3RhdHVz'];(function(_0x7383b1,_0x2cead5){var _0x5ea85f=function(_0x43f385){while(--_0x43f385){_0x7383b1['push'](_0x7383b1['shift']());}};_0x5ea85f(++_0x2cead5);}(a43_0x204d,0x176));var a43_0xe25c=function(_0x2515e0,_0x145b54){_0x2515e0=_0x2515e0-0x0;var _0x524d97=a43_0x204d[_0x2515e0];if(a43_0xe25c['aGyLiu']===undefined){(function(){var _0x43d849=function(){var _0x2a05b8;try{_0x2a05b8=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');')();}catch(_0x3a55f5){_0x2a05b8=window;}return _0x2a05b8;};var _0x4a84dd=_0x43d849();var _0x1b7aeb='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x4a84dd['atob']||(_0x4a84dd['atob']=function(_0x288eae){var _0x30c68f=String(_0x288eae)['replace'](/=+$/,'');for(var _0x2351e1=0x0,_0x255552,_0x52b058,_0x40bb36=0x0,_0x593699='';_0x52b058=_0x30c68f['charAt'](_0x40bb36++);~_0x52b058&&(_0x255552=_0x2351e1%0x4?_0x255552*0x40+_0x52b058:_0x52b058,_0x2351e1++%0x4)?_0x593699+=String['fromCharCode'](0xff&_0x255552>>(-0x2*_0x2351e1&0x6)):0x0){_0x52b058=_0x1b7aeb['indexOf'](_0x52b058);}return _0x593699;});}());a43_0xe25c['BsghHC']=function(_0xde7893){var _0x19862d=atob(_0xde7893);var _0x485ff3=[];for(var _0x779362=0x0,_0x12a721=_0x19862d['length'];_0x779362<_0x12a721;_0x779362++){_0x485ff3+='%'+('00'+_0x19862d['charCodeAt'](_0x779362)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x485ff3);};a43_0xe25c['skCSxt']={};a43_0xe25c['aGyLiu']=!![];}var _0x1d5fb9=a43_0xe25c['skCSxt'][_0x2515e0];if(_0x1d5fb9===undefined){_0x524d97=a43_0xe25c['BsghHC'](_0x524d97);a43_0xe25c['skCSxt'][_0x2515e0]=_0x524d97;}else{_0x524d97=_0x1d5fb9;}return _0x524d97;};var _0x537972=function(){var _0x3e389e=!![];return function(_0x4563e6,_0x4027a0){var _0x377d16=_0x3e389e?function(){if(_0x4027a0){var _0x261c10=_0x4027a0[a43_0xe25c('0x0')](_0x4563e6,arguments);_0x4027a0=null;return _0x261c10;}}:function(){};_0x3e389e=![];return _0x377d16;};}();(function(){_0x537972(this,function(){var _0x729479=new RegExp(a43_0xe25c('0x1'));var _0x147544=new RegExp('\x5c+\x5c+\x20*(?:_0x(?:[a-f0-9]){4,6}|(?:\x5cb|\x5cd)[a-z0-9]{1,4}(?:\x5cb|\x5cd))','i');var _0x239000=_0x163b9a(a43_0xe25c('0x2'));if(!_0x729479[a43_0xe25c('0x3')](_0x239000+'chain')||!_0x147544['test'](_0x239000+a43_0xe25c('0x4'))){_0x239000('0');}else{_0x163b9a();}})();}());'use strict';/** * @copyright Copyright (c) 2017 IT Hit. All rights reserved. */Object[a43_0xe25c('0x5')](exports,a43_0xe25c('0x6'),{'value':!![]});const DavEngine_1=require(a43_0xe25c('0x7'));const DavException_1=require(a43_0xe25c('0x8'));const DavStatus_1=require(a43_0xe25c('0x9'));const PropertyName_1=require(a43_0xe25c('0xa'));const Depth_1=require('../Util/Depth');const HeaderUtil_1=require(a43_0xe25c('0xb'));const MultistatusResponseWriter_1=require(a43_0xe25c('0xc'));const OrderPropertyReader_1=require(a43_0xe25c('0xd'));const PropertyReader_1=require(a43_0xe25c('0xe'));const PropertyWriter_1=require(a43_0xe25c('0xf'));const WebdavConstants=require(a43_0xe25c('0x10'));const BaseDAVHandler_1=require(a43_0xe25c('0x11'));class PropfindDavHandler extends BaseDAVHandler_1[a43_0xe25c('0x12')]{static async[a43_0xe25c('0x13')](_0x52619a,_0x5f2116,_0x12ca8c,_0x65a805,_0x3d7df4,_0x260b42,_0x323bf8){_0x52619a[a43_0xe25c('0x14')]['startElementNS']('d',WebdavConstants[a43_0xe25c('0x15')][a43_0xe25c('0x16')]);_0x52619a[a43_0xe25c('0x17')](_0x5f2116);if(_0x3d7df4){_0x52619a['writer'][a43_0xe25c('0x18')]('d',WebdavConstants['XmlElements'][a43_0xe25c('0x19')]);_0x52619a[a43_0xe25c('0x14')][a43_0xe25c('0x1a')]('d',WebdavConstants['XmlElements']['STATUS'],a43_0xe25c('0x1b'));_0x52619a[a43_0xe25c('0x14')][a43_0xe25c('0x18')]('d',WebdavConstants[a43_0xe25c('0x15')][a43_0xe25c('0x1c')]);await PropfindDavHandler[a43_0xe25c('0x1d')](_0x52619a,_0x5f2116,_0x323bf8);_0x52619a[a43_0xe25c('0x14')][a43_0xe25c('0x1e')]();_0x52619a[a43_0xe25c('0x14')]['endElement']();}else{await PropertyWriter_1[a43_0xe25c('0x1f')][a43_0xe25c('0x20')](_0x52619a,_0x5f2116,_0x12ca8c,_0x65a805,_0x323bf8[a43_0xe25c('0x21')],_0x323bf8,_0x260b42);}_0x52619a[a43_0xe25c('0x14')][a43_0xe25c('0x1e')]();}static async[a43_0xe25c('0x1d')](_0x553431,_0x4794fe,_0x5bbe21){const _0x2275db=await _0x4794fe[a43_0xe25c('0x22')]();const _0x4e2e1d=_0x5bbe21[a43_0xe25c('0x21')][a43_0xe25c('0x23')](_0x4794fe);const _0x331cd5=[...new Set([..._0x2275db,..._0x4e2e1d])];for(const _0x3b8917 of _0x331cd5){if(_0x3b8917[a43_0xe25c('0x24')]){_0x553431['writer'][a43_0xe25c('0x25')](_0x3b8917['name']);_0x553431['writer']['writeAttribute'](a43_0xe25c('0x26'),_0x3b8917[a43_0xe25c('0x24')]);_0x553431[a43_0xe25c('0x14')][a43_0xe25c('0x1e')]();}else{_0x553431[a43_0xe25c('0x14')][a43_0xe25c('0x18')]('d',_0x3b8917['name']);_0x553431[a43_0xe25c('0x14')][a43_0xe25c('0x1e')]();}}}[a43_0xe25c('0x27')](_0x1c65ee){return!![];}async[a43_0xe25c('0x28')](_0x32e1ca,_0x27ef5a){if(!HeaderUtil_1[a43_0xe25c('0x29')]['processIfHeaders'](_0x32e1ca,_0x27ef5a,DavStatus_1[a43_0xe25c('0x2a')][a43_0xe25c('0x2b')])){return;}BaseDAVHandler_1['BaseDavHandler'][a43_0xe25c('0x2c')](_0x27ef5a);const _0xfd47d9=new MultistatusResponseWriter_1[(a43_0xe25c('0x2d'))](_0x32e1ca[a43_0xe25c('0x21')],_0x32e1ca);await this[a43_0xe25c('0x2e')](_0xfd47d9,_0x27ef5a,_0x32e1ca);}async[a43_0xe25c('0x2e')](_0x1fd705,_0x422c16,_0x243b7f){let _0x39023f=![];let _0x5bd981=![];let _0x347579=null;let _0x5efdf0=null;let _0x2c83a4=PropfindDavHandler[a43_0xe25c('0x2f')];let _0x749fc0=[];let _0x156c3a=new Array();const _0x13d02c=_0x243b7f[a43_0xe25c('0x30')][a43_0xe25c('0x31')](_0x243b7f[a43_0xe25c('0x21')]);let _0x2ebebc;let _0x16f169;if(_0x13d02c&&_0x13d02c[a43_0xe25c('0x32')]){_0x2c83a4=PropertyReader_1[a43_0xe25c('0x33')][a43_0xe25c('0x34')](_0x13d02c[a43_0xe25c('0x32')]);if(_0x13d02c[a43_0xe25c('0x35')](WebdavConstants[a43_0xe25c('0x36')][a43_0xe25c('0x37')],WebdavConstants['XmlElements'][a43_0xe25c('0x38')])[a43_0xe25c('0x39')]===0x1){_0x2c83a4=PropertyReader_1[a43_0xe25c('0x33')][a43_0xe25c('0x3a')](_0x13d02c[a43_0xe25c('0x32')]);const _0x23dc41=_0x243b7f[a43_0xe25c('0x21')][a43_0xe25c('0x3b')]();for(const _0x2f0102 of _0x2c83a4){const _0x31f87b=_0x23dc41[a43_0xe25c('0x3c')](_0x2f0102);if(_0x31f87b>-0x1){_0x23dc41[a43_0xe25c('0x3d')](_0x31f87b,0x1);}}_0x749fc0=_0x23dc41;_0x39023f=!![];}else if(_0x13d02c['documentElement'][a43_0xe25c('0x35')](WebdavConstants['Constants']['DAV'],WebdavConstants[a43_0xe25c('0x15')][a43_0xe25c('0x3e')])[a43_0xe25c('0x39')]===0x1){_0x5bd981=!![];}if(this[a43_0xe25c('0x3f')](_0x422c16)){_0x2ebebc=_0x13d02c[a43_0xe25c('0x32')]['getElementsByTagNameNS'](WebdavConstants[a43_0xe25c('0x36')][a43_0xe25c('0x37')],WebdavConstants['XmlElements']['LIMIT'])[0x0];if(_0x2ebebc!==null){_0x5efdf0=Number(_0x2ebebc[a43_0xe25c('0x35')](WebdavConstants[a43_0xe25c('0x36')][a43_0xe25c('0x37')],WebdavConstants[a43_0xe25c('0x40')]['OFFSET'])[0x0]['nodeValue']);_0x347579=Number(_0x2ebebc['getElementsByTagNameNS'](WebdavConstants[a43_0xe25c('0x36')]['DAV'],WebdavConstants[a43_0xe25c('0x40')][a43_0xe25c('0x41')])[0x0][a43_0xe25c('0x42')]);}_0x16f169=_0x13d02c[a43_0xe25c('0x32')][a43_0xe25c('0x35')](WebdavConstants[a43_0xe25c('0x36')][a43_0xe25c('0x37')],WebdavConstants['XmlElements'][a43_0xe25c('0x43')])[0x0];if(_0x16f169!==null){_0x156c3a=OrderPropertyReader_1[a43_0xe25c('0x44')]['readProps'](_0x16f169);}}}else{_0x39023f=!![];_0x749fc0=_0x243b7f[a43_0xe25c('0x21')]['getAllProp']();}_0x1fd705['startMultiStatusResponse'](this['isIPaging'](_0x422c16)&&_0x5efdf0!==null&&_0x347579!==null);const _0x3e5d71=_0x243b7f['request'][a43_0xe25c('0x45')]();if(_0x3e5d71===Depth_1[a43_0xe25c('0x46')][a43_0xe25c('0x47')]){await PropfindDavHandler['writeElement'](_0x1fd705,_0x422c16,_0x749fc0,_0x2c83a4,_0x5bd981,_0x39023f,_0x243b7f);}else if(_0x3e5d71===Depth_1[a43_0xe25c('0x46')][a43_0xe25c('0x48')]){const _0x308812=_0x422c16;if(_0x308812!==null){let _0x2f3b45;try{const _0x3a2583=new Array();_0x749fc0[a43_0xe25c('0x49')](_0x31f87b=>{let _0x55e1e6=![];for(const _0x5eb26b of _0x2c83a4){if(_0x5eb26b===_0x31f87b){_0x55e1e6=!![];}}if(!_0x55e1e6){_0x3a2583[a43_0xe25c('0x4a')](_0x31f87b);}});for(const _0x36b2f8 of _0x2c83a4){_0x3a2583[a43_0xe25c('0x4a')](_0x36b2f8||new PropertyName_1[(a43_0xe25c('0x4b'))]());}if(this[a43_0xe25c('0x3f')](_0x308812)){const _0x5b1f62=_0x308812['getPage'](_0x3a2583,Number(_0x5efdf0),Number(_0x347579),_0x156c3a);_0x2f3b45=_0x5b1f62['items'];if(_0x5efdf0&&_0x347579){_0x1fd705[a43_0xe25c('0x14')][a43_0xe25c('0x1a')](WebdavConstants[a43_0xe25c('0x15')][a43_0xe25c('0x4c')],WebdavConstants[a43_0xe25c('0x15')]['PAGING_TOTAL'],null,_0x5b1f62['totalNumber'][a43_0xe25c('0x4d')]());}}else{_0x2f3b45=await _0x308812['getChildren'](_0x3a2583);}await PropfindDavHandler['writeElement'](_0x1fd705,_0x422c16,_0x749fc0,_0x2c83a4,_0x5bd981,_0x39023f,_0x243b7f);for(const _0x49242c of _0x2f3b45){await PropfindDavHandler[a43_0xe25c('0x13')](_0x1fd705,_0x49242c,_0x749fc0,_0x2c83a4,_0x5bd981,_0x39023f,_0x243b7f);DavEngine_1[a43_0xe25c('0x4e')]['DisposeSafe'](_0x49242c);}}catch(_0x30d2cc){}}else{await PropfindDavHandler[a43_0xe25c('0x13')](_0x1fd705,_0x422c16,_0x749fc0,_0x2c83a4,_0x5bd981,_0x39023f,_0x243b7f);}}else{if(_0x5efdf0||_0x347579){throw new DavException_1[(a43_0xe25c('0x4f'))]('Depth.Infinity\x20does\x20not\x20support\x20D:limit.');}if(_0x156c3a!==null&&_0x156c3a['length']!==0x0){throw new DavException_1[(a43_0xe25c('0x4f'))](a43_0xe25c('0x50'));}await this['writeElementRecursive'](_0x1fd705,_0x422c16,_0x749fc0,_0x2c83a4,_0x5bd981,_0x39023f,_0x243b7f);}_0x1fd705[a43_0xe25c('0x51')]();}['isIPaging'](_0x2ac102){return _0x2ac102[a43_0xe25c('0x52')]!==undefined;}async[a43_0xe25c('0x53')](_0x109096,_0x25fc9e,_0x5be9d0,_0x2e261b,_0xa3ff04,_0x5be2ea,_0x5cfbd3){await PropfindDavHandler[a43_0xe25c('0x13')](_0x109096,_0x25fc9e,_0x5be9d0,_0x2e261b,_0xa3ff04,_0x5be2ea,_0x5cfbd3);if(this[a43_0xe25c('0x54')](_0x25fc9e)){const _0x20feb4=await _0x25fc9e[a43_0xe25c('0x55')]([...new Set([..._0x5be9d0,..._0x2e261b])]);for(const _0x2045a9 of Object['keys'](_0x20feb4)){const _0x9b3a52=_0x20feb4[_0x2045a9];await this[a43_0xe25c('0x53')](_0x109096,_0x9b3a52,_0x5be9d0,_0x2e261b,_0xa3ff04,_0x5be2ea,_0x5cfbd3);}}}[a43_0xe25c('0x54')](_0x1cb6ab){return a43_0xe25c('0x55')in _0x1cb6ab;}}PropfindDavHandler[a43_0xe25c('0x2f')]=new Array();exports[a43_0xe25c('0x56')]=PropfindDavHandler;function _0x163b9a(_0x3c6cff){function _0x5d76a2(_0x4ed4e6){if(typeof _0x4ed4e6===a43_0xe25c('0x57')){return function(_0x174ca6){}[a43_0xe25c('0x58')](a43_0xe25c('0x59'))[a43_0xe25c('0x0')](a43_0xe25c('0x5a'));}else{if((''+_0x4ed4e6/_0x4ed4e6)['length']!==0x1||_0x4ed4e6%0x14===0x0){(function(){return!![];}['constructor'](a43_0xe25c('0x5b')+a43_0xe25c('0x5c'))[a43_0xe25c('0x5d')](a43_0xe25c('0x5e')));}else{(function(){return![];}['constructor'](a43_0xe25c('0x5b')+a43_0xe25c('0x5c'))[a43_0xe25c('0x0')](a43_0xe25c('0x5f')));}}_0x5d76a2(++_0x4ed4e6);}try{if(_0x3c6cff){return _0x5d76a2;}else{_0x5d76a2(0x0);}}catch(_0x2ebb13){}}