summaryrefslogtreecommitdiffstats
path: root/dist/core-files_client.js
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-11-03 19:44:44 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-11-08 08:39:14 +0100
commit50417bcee8f103fb569a860b63cf8cf1e6bc1c18 (patch)
tree5b92e8bdb948fb5ccc0d06270c840c42eaee8f57 /dist/core-files_client.js
parentcf6c921376effdf7e3682388237f675bb1520945 (diff)
downloadnextcloud-server-50417bcee8f103fb569a860b63cf8cf1e6bc1c18.tar.gz
nextcloud-server-50417bcee8f103fb569a860b63cf8cf1e6bc1c18.zip
chore(jest): update snapshot after component update
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'dist/core-files_client.js')
-rw-r--r--dist/core-files_client.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/dist/core-files_client.js b/dist/core-files_client.js
index 98d1bd23302..1624903badd 100644
--- a/dist/core-files_client.js
+++ b/dist/core-files_client.js
@@ -1,3 +1,3 @@
/*! For license information please see core-files_client.js.LICENSE.txt */
-!function(){"use strict";var e,t={7913:function(e,t,r){var s=r(95573),n=r.n(s),i=r(25108);!function(e,t){var r=function t(r){this._root=r.root,"/"===this._root.charAt(this._root.length-1)&&(this._root=this._root.substr(0,this._root.length-1));var s=t.PROTOCOL_HTTP+"://";r.useHTTPS&&(s=t.PROTOCOL_HTTPS+"://"),s+=r.host+this._root,this._host=r.host,this._defaultHeaders=r.defaultHeaders||{"X-Requested-With":"XMLHttpRequest",requesttoken:e.requestToken},this._baseUrl=s;var n={baseUrl:this._baseUrl,xmlNamespaces:{"DAV:":"d","http://owncloud.org/ns":"oc","http://nextcloud.org/ns":"nc","http://open-collaboration-services.org/ns":"ocs"}};r.userName&&(n.userName=r.userName),r.password&&(n.password=r.password),this._client=new dav.Client(n),this._client.xhrProvider=_.bind(this._xhrProvider,this),this._fileInfoParsers=[]};r.NS_OWNCLOUD="http://owncloud.org/ns",r.NS_NEXTCLOUD="http://nextcloud.org/ns",r.NS_DAV="DAV:",r.NS_OCS="http://open-collaboration-services.org/ns",r.PROPERTY_GETLASTMODIFIED="{"+r.NS_DAV+"}getlastmodified",r.PROPERTY_GETETAG="{"+r.NS_DAV+"}getetag",r.PROPERTY_GETCONTENTTYPE="{"+r.NS_DAV+"}getcontenttype",r.PROPERTY_RESOURCETYPE="{"+r.NS_DAV+"}resourcetype",r.PROPERTY_INTERNAL_FILEID="{"+r.NS_OWNCLOUD+"}fileid",r.PROPERTY_PERMISSIONS="{"+r.NS_OWNCLOUD+"}permissions",r.PROPERTY_SIZE="{"+r.NS_OWNCLOUD+"}size",r.PROPERTY_GETCONTENTLENGTH="{"+r.NS_DAV+"}getcontentlength",r.PROPERTY_ISENCRYPTED="{"+r.NS_DAV+"}is-encrypted",r.PROPERTY_SHARE_PERMISSIONS="{"+r.NS_OCS+"}share-permissions",r.PROPERTY_SHARE_ATTRIBUTES="{"+r.NS_NEXTCLOUD+"}share-attributes",r.PROPERTY_QUOTA_AVAILABLE_BYTES="{"+r.NS_DAV+"}quota-available-bytes",r.PROTOCOL_HTTP="http",r.PROTOCOL_HTTPS="https",r._PROPFIND_PROPERTIES=[[r.NS_DAV,"getlastmodified"],[r.NS_DAV,"getetag"],[r.NS_DAV,"getcontenttype"],[r.NS_DAV,"resourcetype"],[r.NS_OWNCLOUD,"fileid"],[r.NS_OWNCLOUD,"permissions"],[r.NS_OWNCLOUD,"size"],[r.NS_DAV,"getcontentlength"],[r.NS_DAV,"quota-available-bytes"],[r.NS_NEXTCLOUD,"has-preview"],[r.NS_NEXTCLOUD,"mount-type"],[r.NS_NEXTCLOUD,"is-encrypted"],[r.NS_OCS,"share-permissions"],[r.NS_NEXTCLOUD,"share-attributes"]],r.prototype={_root:null,_client:null,_fileInfoParsers:[],_xhrProvider:function(){var t=this._defaultHeaders,r=new XMLHttpRequest,s=r.open;return r.open=function(){var e=s.apply(this,arguments);return _.each(t,(function(e,t){r.setRequestHeader(t,e)})),e},e.registerXHRForErrorProcessing(r),r},_buildUrl:function(){var e=this._buildPath.apply(this,arguments);return"/"===e.charAt([e.length-1])&&(e=e.substr(0,e.length-1)),"/"===e.charAt(0)&&(e=e.substr(1)),this._baseUrl+"/"+e},_buildPath:function(){var t,r=e.joinPaths.apply(this,arguments),s=r.split("/");for(t=0;t<s.length;t++)s[t]=encodeURIComponent(s[t]);return s.join("/")},_parseHeaders:function(e){for(var t=e.split("\n"),r={},s=0;s<t.length;s++){var n=t[s].indexOf(":");if(!(n<0)){var i=t[s].substr(0,n),o=t[s].substr(n+2);r[i]||(r[i]=[]),r[i].push(o)}}return r},_parseEtag:function(e){return'"'===e.charAt(0)?e.split('"')[1]:e},_parseFileInfo:function(s){var n=decodeURIComponent(s.href);if(n.substr(0,this._root.length)===this._root&&(n=n.substr(this._root.length)),"/"===n.charAt(n.length-1)&&(n=n.substr(0,n.length-1)),0===s.propStat.length||"HTTP/1.1 200 OK"!==s.propStat[0].status)return null;var o=s.propStat[0].properties,a={id:o[r.PROPERTY_INTERNAL_FILEID],path:e.dirname(n)||"/",name:e.basename(n),mtime:new Date(o[r.PROPERTY_GETLASTMODIFIED]).getTime()},u=o[r.PROPERTY_GETETAG];_.isUndefined(u)||(a.etag=this._parseEtag(u));var l=o[r.PROPERTY_GETCONTENTLENGTH];_.isUndefined(l)||(a.size=parseInt(l,10)),l=o[r.PROPERTY_SIZE],_.isUndefined(l)||(a.size=parseInt(l,10));var c=o["{"+r.NS_NEXTCLOUD+"}has-preview"];_.isUndefined(c)?a.hasPreview=!0:a.hasPreview="true"===c;var p=o["{"+r.NS_NEXTCLOUD+"}is-encrypted"];_.isUndefined(p)?a.isEncrypted=!1:a.isEncrypted="1"===p;var h=o["{"+r.NS_OWNCLOUD+"}favorite"];_.isUndefined(h)?a.isFavourited=!1:a.isFavourited="1"===h;var f=o[r.PROPERTY_GETCONTENTTYPE];_.isUndefined(f)||(a.mimetype=f);var d=o[r.PROPERTY_RESOURCETYPE];if(!a.mimetype&&d){var S=d[0];S.namespaceURI===r.NS_DAV&&"collection"===S.nodeName.split(":")[1]&&(a.mimetype="httpd/unix-directory")}a.permissions=e.PERMISSION_NONE;var P=o[r.PROPERTY_PERMISSIONS];if(!_.isUndefined(P)){var E=P||"";a.mountType=null;for(var T=0;T<E.length;T++)switch(E.charAt(T)){case"C":case"K":a.permissions|=e.PERMISSION_CREATE;break;case"G":a.permissions|=e.PERMISSION_READ;break;case"W":case"N":case"V":a.permissions|=e.PERMISSION_UPDATE;break;case"D":a.permissions|=e.PERMISSION_DELETE;break;case"R":a.permissions|=e.PERMISSION_SHARE;break;case"M":a.mountType||(a.mountType="external");break;case"S":a.mountType="shared"}}var O=o[r.PROPERTY_SHARE_PERMISSIONS];_.isUndefined(O)||(a.sharePermissions=parseInt(O));var v=o[r.PROPERTY_SHARE_ATTRIBUTES];if(_.isUndefined(v))a.shareAttributes=[];else try{a.shareAttributes=JSON.parse(v)}catch(e){i.warn('Could not parse share attributes returned by server: "'+v+'"'),a.shareAttributes=[]}var g=o["{"+r.NS_NEXTCLOUD+"}mount-type"];_.isUndefined(g)||(a.mountType=g);var N=o["{"+r.NS_DAV+"}quota-available-bytes"];return _.isUndefined(N)||(a.quotaAvailableBytes=N),_.each(this._fileInfoParsers,(function(e){_.extend(a,e(s,a)||{})})),new t(a)},_parseResult:function(e){var t=this;return _.map(e,(function(e){return t._parseFileInfo(e)}))},_isSuccessStatus:function(e){return e>=200&&e<=299},_getSabreException:function(e){var t={},r=e.xhr.responseXML;if(null===r)return t;var s=r.getElementsByTagNameNS("http://sabredav.org/ns","message"),n=r.getElementsByTagNameNS("http://sabredav.org/ns","exception");return s.length&&(t.message=s[0].textContent),n.length&&(t.exception=n[0].textContent),t},getPropfindProperties:function(){return this._propfindProperties||(this._propfindProperties=_.map(r._PROPFIND_PROPERTIES,(function(e){return"{"+e[0]+"}"+e[1]}))),this._propfindProperties},getFolderContents:function(e,t){e||(e=""),t=t||{};var r,s=this,n=$.Deferred(),i=n.promise();return r=_.isUndefined(t.properties)?this.getPropfindProperties():t.properties,this._client.propFind(this._buildUrl(e),r,1).then((function(e){if(s._isSuccessStatus(e.status)){var r=s._parseResult(e.body);t&&t.includeParent||r.shift(),n.resolve(e.status,r)}else e=_.extend(e,s._getSabreException(e)),n.reject(e.status,e)})),i},getFilteredFiles:function(e,t){t=t||{};var r,s=this,i=$.Deferred(),o=i.promise();if(r=_.isUndefined(t.properties)?this.getPropfindProperties():t.properties,!e||!e.systemTagIds&&_.isUndefined(e.favorite)&&!e.circlesIds)throw"Missing filter argument";var a,u="<oc:filter-files ";for(a in this._client.xmlNamespaces)u+=" xmlns:"+this._client.xmlNamespaces[a]+'="'+a+'"';return u+=">\n",u+=" <"+this._client.xmlNamespaces["DAV:"]+":prop>\n",_.each(r,(function(e){var t=s._client.parseClarkNotation(e);u+=" <"+s._client.xmlNamespaces[t.namespace]+":"+t.name+" />\n"})),u+=" </"+this._client.xmlNamespaces["DAV:"]+":prop>\n",u+=" <oc:filter-rules>\n",_.each(e.systemTagIds,(function(e){u+=" <oc:systemtag>"+n()(e)+"</oc:systemtag>\n"})),_.each(e.circlesIds,(function(e){u+=" <oc:circle>"+n()(e)+"</oc:circle>\n"})),e.favorite&&(u+=" <oc:favorite>"+(e.favorite?"1":"0")+"</oc:favorite>\n"),u+=" </oc:filter-rules>\n",u+="</oc:filter-files>\n",this._client.request("REPORT",this._buildUrl(),{},u).then((function(e){if(s._isSuccessStatus(e.status)){var t=s._parseResult(e.body);i.resolve(e.status,t)}else e=_.extend(e,s._getSabreException(e)),i.reject(e.status,e)})),o},getFileInfo:function(e,t){e||(e=""),t=t||{};var r,s=this,n=$.Deferred(),i=n.promise();return r=_.isUndefined(t.properties)?this.getPropfindProperties():t.properties,this._client.propFind(this._buildUrl(e),r,0).then((function(e){s._isSuccessStatus(e.status)?n.resolve(e.status,s._parseResult([e.body])[0]):(e=_.extend(e,s._getSabreException(e)),n.reject(e.status,e))})),i},getFileContents:function(e){if(!e)throw'Missing argument "path"';var t=this,r=$.Deferred(),s=r.promise();return this._client.request("GET",this._buildUrl(e)).then((function(e){t._isSuccessStatus(e.status)?r.resolve(e.status,e.body):(e=_.extend(e,t._getSabreException(e)),r.reject(e.status,e))})),s},putFileContents:function(e,t,r){if(!e)throw'Missing argument "path"';var s=this,n=$.Deferred(),i=n.promise(),o={},a="text/plain;charset=utf-8";return(r=r||{}).contentType&&(a=r.contentType),o["Content-Type"]=a,(_.isUndefined(r.overwrite)||r.overwrite)&&(o["If-None-Match"]="*"),this._client.request("PUT",this._buildUrl(e),o,t||"").then((function(e){s._isSuccessStatus(e.status)?n.resolve(e.status):(e=_.extend(e,s._getSabreException(e)),n.reject(e.status,e))})),i},_simpleCall:function(e,t,r){if(!t)throw'Missing argument "path"';var s=this,n=$.Deferred(),i=n.promise();return this._client.request(e,this._buildUrl(t),r||{}).then((function(e){s._isSuccessStatus(e.status)?n.resolve(e.status):(e=_.extend(e,s._getSabreException(e)),n.reject(e.status,e))})),i},createDirectory:function(e,t){return this._simpleCall("MKCOL",e,t)},remove:function(e){return this._simpleCall("DELETE",e)},move:function(e,t,r,s){if(!e)throw'Missing argument "path"';if(!t)throw'Missing argument "destinationPath"';var n=this,i=$.Deferred(),o=i.promise();return s=_.extend({},s,{Destination:this._buildUrl(t)}),r||(s.Overwrite="F"),this._client.request("MOVE",this._buildUrl(e),s).then((function(e){n._isSuccessStatus(e.status)?i.resolve(e.status):(e=_.extend(e,n._getSabreException(e)),i.reject(e.status,e))})),o},copy:function(e,t,r){if(!e)throw'Missing argument "path"';if(!t)throw'Missing argument "destinationPath"';var s=this,n=$.Deferred(),i=n.promise(),o={Destination:this._buildUrl(t)};return r||(o.Overwrite="F"),this._client.request("COPY",this._buildUrl(e),o).then((function(e){s._isSuccessStatus(e.status)?n.resolve(e.status):n.reject(e.status)})),i},addFileInfoParser:function(e){this._fileInfoParsers.push(e)},getClient:function(){return this._client},getUserName:function(){return this._client.userName},getPassword:function(){return this._client.password},getBaseUrl:function(){return this._client.baseUrl},getHost:function(){return this._host}},e.Files||(e.Files={}),e.Files.getClient=function(){if(e.Files._defaultClient)return e.Files._defaultClient;var t=new e.Files.Client({host:e.getHost(),port:e.getPort(),root:e.linkToRemoteBase("dav")+"/files/"+e.getCurrentUser().uid,useHTTPS:"https"===e.getProtocol()});return e.Files._defaultClient=t,t},e.Files.Client=r}(OC,OC.Files.FileInfo)}},r={};function s(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(i.exports,i,i.exports,s),i.loaded=!0,i.exports}s.m=t,e=[],s.O=function(t,r,n,i){if(!r){var o=1/0;for(c=0;c<e.length;c++){r=e[c][0],n=e[c][1],i=e[c][2];for(var a=!0,u=0;u<r.length;u++)(!1&i||o>=i)&&Object.keys(s.O).every((function(e){return s.O[e](r[u])}))?r.splice(u--,1):(a=!1,i<o&&(o=i));if(a){e.splice(c--,1);var l=n();void 0!==l&&(t=l)}}return t}i=i||0;for(var c=e.length;c>0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[r,n,i]},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.e=function(){return Promise.resolve()},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},s.j=5578,function(){s.b=document.baseURI||self.location.href;var e={5578:0};s.O.j=function(t){return 0===e[t]};var t=function(t,r){var n,i,o=r[0],a=r[1],u=r[2],l=0;if(o.some((function(t){return 0!==e[t]}))){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);if(u)var c=u(s)}for(t&&t(r);l<o.length;l++)i=o[l],s.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return s.O(c)},r=self.webpackChunknextcloud=self.webpackChunknextcloud||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}(),s.nc=void 0;var n=s.O(void 0,[7874],(function(){return s(7913)}));n=s.O(n)}();
-//# sourceMappingURL=core-files_client.js.map?v=6c2648a3e304efe1b51d \ No newline at end of file
+(()=>{"use strict";var e,t={7913:(e,t,s)=>{var n=s(95573),r=s.n(n),i=s(25108);!function(e,t){var s=function(t){this._root=t.root,"/"===this._root.charAt(this._root.length-1)&&(this._root=this._root.substr(0,this._root.length-1));let n=s.PROTOCOL_HTTP+"://";t.useHTTPS&&(n=s.PROTOCOL_HTTPS+"://"),n+=t.host+this._root,this._host=t.host,this._defaultHeaders=t.defaultHeaders||{"X-Requested-With":"XMLHttpRequest",requesttoken:e.requestToken},this._baseUrl=n;const r={baseUrl:this._baseUrl,xmlNamespaces:{"DAV:":"d","http://owncloud.org/ns":"oc","http://nextcloud.org/ns":"nc","http://open-collaboration-services.org/ns":"ocs"}};t.userName&&(r.userName=t.userName),t.password&&(r.password=t.password),this._client=new dav.Client(r),this._client.xhrProvider=_.bind(this._xhrProvider,this),this._fileInfoParsers=[]};s.NS_OWNCLOUD="http://owncloud.org/ns",s.NS_NEXTCLOUD="http://nextcloud.org/ns",s.NS_DAV="DAV:",s.NS_OCS="http://open-collaboration-services.org/ns",s.PROPERTY_GETLASTMODIFIED="{"+s.NS_DAV+"}getlastmodified",s.PROPERTY_GETETAG="{"+s.NS_DAV+"}getetag",s.PROPERTY_GETCONTENTTYPE="{"+s.NS_DAV+"}getcontenttype",s.PROPERTY_RESOURCETYPE="{"+s.NS_DAV+"}resourcetype",s.PROPERTY_INTERNAL_FILEID="{"+s.NS_OWNCLOUD+"}fileid",s.PROPERTY_PERMISSIONS="{"+s.NS_OWNCLOUD+"}permissions",s.PROPERTY_SIZE="{"+s.NS_OWNCLOUD+"}size",s.PROPERTY_GETCONTENTLENGTH="{"+s.NS_DAV+"}getcontentlength",s.PROPERTY_ISENCRYPTED="{"+s.NS_DAV+"}is-encrypted",s.PROPERTY_SHARE_PERMISSIONS="{"+s.NS_OCS+"}share-permissions",s.PROPERTY_SHARE_ATTRIBUTES="{"+s.NS_NEXTCLOUD+"}share-attributes",s.PROPERTY_QUOTA_AVAILABLE_BYTES="{"+s.NS_DAV+"}quota-available-bytes",s.PROTOCOL_HTTP="http",s.PROTOCOL_HTTPS="https",s._PROPFIND_PROPERTIES=[[s.NS_DAV,"getlastmodified"],[s.NS_DAV,"getetag"],[s.NS_DAV,"getcontenttype"],[s.NS_DAV,"resourcetype"],[s.NS_OWNCLOUD,"fileid"],[s.NS_OWNCLOUD,"permissions"],[s.NS_OWNCLOUD,"size"],[s.NS_DAV,"getcontentlength"],[s.NS_DAV,"quota-available-bytes"],[s.NS_NEXTCLOUD,"has-preview"],[s.NS_NEXTCLOUD,"mount-type"],[s.NS_NEXTCLOUD,"is-encrypted"],[s.NS_OCS,"share-permissions"],[s.NS_NEXTCLOUD,"share-attributes"]],s.prototype={_root:null,_client:null,_fileInfoParsers:[],_xhrProvider:function(){const t=this._defaultHeaders,s=new XMLHttpRequest,n=s.open;return s.open=function(){const e=n.apply(this,arguments);return _.each(t,(function(e,t){s.setRequestHeader(t,e)})),e},e.registerXHRForErrorProcessing(s),s},_buildUrl:function(){let e=this._buildPath.apply(this,arguments);return"/"===e.charAt([e.length-1])&&(e=e.substr(0,e.length-1)),"/"===e.charAt(0)&&(e=e.substr(1)),this._baseUrl+"/"+e},_buildPath:function(){let t=e.joinPaths.apply(this,arguments);const s=t.split("/");let n;for(n=0;n<s.length;n++)s[n]=encodeURIComponent(s[n]);return t=s.join("/"),t},_parseHeaders:function(e){const t=e.split("\n"),s={};for(let e=0;e<t.length;e++){const n=t[e].indexOf(":");if(n<0)continue;const r=t[e].substr(0,n),i=t[e].substr(n+2);s[r]||(s[r]=[]),s[r].push(i)}return s},_parseEtag:function(e){return'"'===e.charAt(0)?e.split('"')[1]:e},_parseFileInfo:function(n){let r=decodeURIComponent(n.href);if(r.substr(0,this._root.length)===this._root&&(r=r.substr(this._root.length)),"/"===r.charAt(r.length-1)&&(r=r.substr(0,r.length-1)),0===n.propStat.length||"HTTP/1.1 200 OK"!==n.propStat[0].status)return null;const o=n.propStat[0].properties,a={id:o[s.PROPERTY_INTERNAL_FILEID],path:e.dirname(r)||"/",name:e.basename(r),mtime:new Date(o[s.PROPERTY_GETLASTMODIFIED]).getTime()},c=o[s.PROPERTY_GETETAG];_.isUndefined(c)||(a.etag=this._parseEtag(c));let u=o[s.PROPERTY_GETCONTENTLENGTH];_.isUndefined(u)||(a.size=parseInt(u,10)),u=o[s.PROPERTY_SIZE],_.isUndefined(u)||(a.size=parseInt(u,10));const l=o["{"+s.NS_NEXTCLOUD+"}has-preview"];_.isUndefined(l)?a.hasPreview=!0:a.hasPreview="true"===l;const p=o["{"+s.NS_NEXTCLOUD+"}is-encrypted"];_.isUndefined(p)?a.isEncrypted=!1:a.isEncrypted="1"===p;const h=o["{"+s.NS_OWNCLOUD+"}favorite"];_.isUndefined(h)?a.isFavourited=!1:a.isFavourited="1"===h;const d=o[s.PROPERTY_GETCONTENTTYPE];_.isUndefined(d)||(a.mimetype=d);const f=o[s.PROPERTY_RESOURCETYPE];if(!a.mimetype&&f){const e=f[0];e.namespaceURI===s.NS_DAV&&"collection"===e.nodeName.split(":")[1]&&(a.mimetype="httpd/unix-directory")}a.permissions=e.PERMISSION_NONE;const S=o[s.PROPERTY_PERMISSIONS];if(!_.isUndefined(S)){const t=S||"";a.mountType=null;for(let s=0;s<t.length;s++)switch(t.charAt(s)){case"C":case"K":a.permissions|=e.PERMISSION_CREATE;break;case"G":a.permissions|=e.PERMISSION_READ;break;case"W":case"N":case"V":a.permissions|=e.PERMISSION_UPDATE;break;case"D":a.permissions|=e.PERMISSION_DELETE;break;case"R":a.permissions|=e.PERMISSION_SHARE;break;case"M":a.mountType||(a.mountType="external");break;case"S":a.mountType="shared"}}const P=o[s.PROPERTY_SHARE_PERMISSIONS];_.isUndefined(P)||(a.sharePermissions=parseInt(P));const E=o[s.PROPERTY_SHARE_ATTRIBUTES];if(_.isUndefined(E))a.shareAttributes=[];else try{a.shareAttributes=JSON.parse(E)}catch(e){i.warn('Could not parse share attributes returned by server: "'+E+'"'),a.shareAttributes=[]}const T=o["{"+s.NS_NEXTCLOUD+"}mount-type"];_.isUndefined(T)||(a.mountType=T);const O=o["{"+s.NS_DAV+"}quota-available-bytes"];return _.isUndefined(O)||(a.quotaAvailableBytes=O),_.each(this._fileInfoParsers,(function(e){_.extend(a,e(n,a)||{})})),new t(a)},_parseResult:function(e){const t=this;return _.map(e,(function(e){return t._parseFileInfo(e)}))},_isSuccessStatus:function(e){return e>=200&&e<=299},_getSabreException:function(e){const t={},s=e.xhr.responseXML;if(null===s)return t;const n=s.getElementsByTagNameNS("http://sabredav.org/ns","message"),r=s.getElementsByTagNameNS("http://sabredav.org/ns","exception");return n.length&&(t.message=n[0].textContent),r.length&&(t.exception=r[0].textContent),t},getPropfindProperties:function(){return this._propfindProperties||(this._propfindProperties=_.map(s._PROPFIND_PROPERTIES,(function(e){return"{"+e[0]+"}"+e[1]}))),this._propfindProperties},getFolderContents:function(e,t){e||(e=""),t=t||{};const s=this,n=$.Deferred(),r=n.promise();let i;return i=_.isUndefined(t.properties)?this.getPropfindProperties():t.properties,this._client.propFind(this._buildUrl(e),i,1).then((function(e){if(s._isSuccessStatus(e.status)){const r=s._parseResult(e.body);t&&t.includeParent||r.shift(),n.resolve(e.status,r)}else e=_.extend(e,s._getSabreException(e)),n.reject(e.status,e)})),r},getFilteredFiles:function(e,t){t=t||{};const s=this,n=$.Deferred(),i=n.promise();let o;if(o=_.isUndefined(t.properties)?this.getPropfindProperties():t.properties,!e||!e.systemTagIds&&_.isUndefined(e.favorite)&&!e.circlesIds)throw"Missing filter argument";let a,c="<oc:filter-files ";for(a in this._client.xmlNamespaces)c+=" xmlns:"+this._client.xmlNamespaces[a]+'="'+a+'"';return c+=">\n",c+=" <"+this._client.xmlNamespaces["DAV:"]+":prop>\n",_.each(o,(function(e){const t=s._client.parseClarkNotation(e);c+=" <"+s._client.xmlNamespaces[t.namespace]+":"+t.name+" />\n"})),c+=" </"+this._client.xmlNamespaces["DAV:"]+":prop>\n",c+=" <oc:filter-rules>\n",_.each(e.systemTagIds,(function(e){c+=" <oc:systemtag>"+r()(e)+"</oc:systemtag>\n"})),_.each(e.circlesIds,(function(e){c+=" <oc:circle>"+r()(e)+"</oc:circle>\n"})),e.favorite&&(c+=" <oc:favorite>"+(e.favorite?"1":"0")+"</oc:favorite>\n"),c+=" </oc:filter-rules>\n",c+="</oc:filter-files>\n",this._client.request("REPORT",this._buildUrl(),{},c).then((function(e){if(s._isSuccessStatus(e.status)){const t=s._parseResult(e.body);n.resolve(e.status,t)}else e=_.extend(e,s._getSabreException(e)),n.reject(e.status,e)})),i},getFileInfo:function(e,t){e||(e=""),t=t||{};const s=this,n=$.Deferred(),r=n.promise();let i;return i=_.isUndefined(t.properties)?this.getPropfindProperties():t.properties,this._client.propFind(this._buildUrl(e),i,0).then((function(e){s._isSuccessStatus(e.status)?n.resolve(e.status,s._parseResult([e.body])[0]):(e=_.extend(e,s._getSabreException(e)),n.reject(e.status,e))})),r},getFileContents:function(e){if(!e)throw'Missing argument "path"';const t=this,s=$.Deferred(),n=s.promise();return this._client.request("GET",this._buildUrl(e)).then((function(e){t._isSuccessStatus(e.status)?s.resolve(e.status,e.body):(e=_.extend(e,t._getSabreException(e)),s.reject(e.status,e))})),n},putFileContents:function(e,t,s){if(!e)throw'Missing argument "path"';const n=this,r=$.Deferred(),i=r.promise(),o={};let a="text/plain;charset=utf-8";return(s=s||{}).contentType&&(a=s.contentType),o["Content-Type"]=a,(_.isUndefined(s.overwrite)||s.overwrite)&&(o["If-None-Match"]="*"),this._client.request("PUT",this._buildUrl(e),o,t||"").then((function(e){n._isSuccessStatus(e.status)?r.resolve(e.status):(e=_.extend(e,n._getSabreException(e)),r.reject(e.status,e))})),i},_simpleCall:function(e,t,s){if(!t)throw'Missing argument "path"';const n=this,r=$.Deferred(),i=r.promise();return this._client.request(e,this._buildUrl(t),s||{}).then((function(e){n._isSuccessStatus(e.status)?r.resolve(e.status):(e=_.extend(e,n._getSabreException(e)),r.reject(e.status,e))})),i},createDirectory:function(e,t){return this._simpleCall("MKCOL",e,t)},remove:function(e){return this._simpleCall("DELETE",e)},move:function(e,t,s,n){if(!e)throw'Missing argument "path"';if(!t)throw'Missing argument "destinationPath"';const r=this,i=$.Deferred(),o=i.promise();return n=_.extend({},n,{Destination:this._buildUrl(t)}),s||(n.Overwrite="F"),this._client.request("MOVE",this._buildUrl(e),n).then((function(e){r._isSuccessStatus(e.status)?i.resolve(e.status):(e=_.extend(e,r._getSabreException(e)),i.reject(e.status,e))})),o},copy:function(e,t,s){if(!e)throw'Missing argument "path"';if(!t)throw'Missing argument "destinationPath"';const n=this,r=$.Deferred(),i=r.promise(),o={Destination:this._buildUrl(t)};return s||(o.Overwrite="F"),this._client.request("COPY",this._buildUrl(e),o).then((function(e){n._isSuccessStatus(e.status)?r.resolve(e.status):r.reject(e.status)})),i},addFileInfoParser:function(e){this._fileInfoParsers.push(e)},getClient:function(){return this._client},getUserName:function(){return this._client.userName},getPassword:function(){return this._client.password},getBaseUrl:function(){return this._client.baseUrl},getHost:function(){return this._host}},e.Files||(e.Files={}),e.Files.getClient=function(){if(e.Files._defaultClient)return e.Files._defaultClient;const t=new e.Files.Client({host:e.getHost(),port:e.getPort(),root:e.linkToRemoteBase("dav")+"/files/"+e.getCurrentUser().uid,useHTTPS:"https"===e.getProtocol()});return e.Files._defaultClient=t,t},e.Files.Client=s}(OC,OC.Files.FileInfo)}},s={};function n(e){var r=s[e];if(void 0!==r)return r.exports;var i=s[e]={id:e,loaded:!1,exports:{}};return t[e].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.m=t,e=[],n.O=(t,s,r,i)=>{if(!s){var o=1/0;for(l=0;l<e.length;l++){s=e[l][0],r=e[l][1],i=e[l][2];for(var a=!0,c=0;c<s.length;c++)(!1&i||o>=i)&&Object.keys(n.O).every((e=>n.O[e](s[c])))?s.splice(c--,1):(a=!1,i<o&&(o=i));if(a){e.splice(l--,1);var u=r();void 0!==u&&(t=u)}}return t}i=i||0;for(var l=e.length;l>0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[s,r,i]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.e=()=>Promise.resolve(),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.j=5578,(()=>{n.b=document.baseURI||self.location.href;var e={5578:0};n.O.j=t=>0===e[t];var t=(t,s)=>{var r,i,o=s[0],a=s[1],c=s[2],u=0;if(o.some((t=>0!==e[t]))){for(r in a)n.o(a,r)&&(n.m[r]=a[r]);if(c)var l=c(n)}for(t&&t(s);u<o.length;u++)i=o[u],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return n.O(l)},s=self.webpackChunknextcloud=self.webpackChunknextcloud||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})(),n.nc=void 0;var r=n.O(void 0,[7874],(()=>n(7913)));r=n.O(r)})();
+//# sourceMappingURL=core-files_client.js.map?v=b3b3cb55670bd3d7f7f4 \ No newline at end of file