mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
2 lines
No EOL
16 KiB
JavaScript
2 lines
No EOL
16 KiB
JavaScript
(()=>{"use strict";var e,t={50082(e,t,s){s.r(t),s.d(t,{VERSION:()=>i.xv,after:()=>Oe.A,all:()=>Ye.A,allKeys:()=>C.A,any:()=>He.A,assign:()=>Y.A,before:()=>Te.A,bind:()=>Ae.A,bindAll:()=>pe.A,chain:()=>ce.A,chunk:()=>mt.A,clone:()=>k.A,collect:()=>xe.A,compact:()=>at.A,compose:()=>Pe.A,constant:()=>X.A,contains:()=>Ve.A,countBy:()=>Je.A,create:()=>V.A,debounce:()=>Se.A,default:()=>Pt.A,defaults:()=>H.A,defer:()=>fe.A,delay:()=>he.A,detect:()=>Ue.A,difference:()=>dt.A,drop:()=>ot.A,each:()=>Ce.A,escape:()=>se.A,every:()=>Ye.A,extend:()=>M.A,extendOwn:()=>Y.A,filter:()=>Fe.A,find:()=>Ue.A,findIndex:()=>Re.A,findKey:()=>Ne.A,findLastIndex:()=>be.A,findWhere:()=>De.A,first:()=>it.A,flatten:()=>ct.A,foldl:()=>we.A,foldr:()=>Le.A,forEach:()=>Ce.A,functions:()=>F.A,get:()=>q.A,groupBy:()=>Ke.A,has:()=>W.A,head:()=>it.A,identity:()=>G.A,include:()=>Ve.A,includes:()=>Ve.A,indexBy:()=>Ze.A,indexOf:()=>ve.A,initial:()=>nt.A,inject:()=>we.A,intersection:()=>pt.A,invert:()=>L.A,invoke:()=>ke.A,isArguments:()=>P.A,isArray:()=>m.A,isArrayBuffer:()=>_.A,isBoolean:()=>c.A,isDataView:()=>S.A,isDate:()=>p.A,isElement:()=>l.A,isEmpty:()=>N.A,isEqual:()=>b.A,isError:()=>h.A,isFinite:()=>O.A,isFunction:()=>E.A,isMap:()=>y.A,isMatch:()=>R.A,isNaN:()=>T.A,isNull:()=>o.A,isNumber:()=>A.A,isObject:()=>r.A,isRegExp:()=>d.A,isSet:()=>I.A,isString:()=>u.A,isSymbol:()=>f.A,isTypedArray:()=>g.A,isUndefined:()=>a.A,isWeakMap:()=>v.A,isWeakSet:()=>U.A,iteratee:()=>le.A,keys:()=>D.A,last:()=>rt.A,lastIndexOf:()=>Ie.A,map:()=>xe.A,mapObject:()=>B.A,matcher:()=>Q.A,matches:()=>Q.A,max:()=>We.A,memoize:()=>de.A,methods:()=>F.A,min:()=>Be.A,mixin:()=>Et.A,negate:()=>Ee.A,noop:()=>z.A,now:()=>te.A,object:()=>_t.A,omit:()=>st.A,once:()=>ge.A,pairs:()=>w.A,partial:()=>ue.A,partition:()=>Qe.A,pick:()=>tt.A,pluck:()=>je.A,property:()=>Z.A,propertyOf:()=>J.A,random:()=>ee.A,range:()=>St.A,reduce:()=>we.A,reduceRight:()=>Le.A,reject:()=>Me.A,rest:()=>ot.A,restArguments:()=>n.A,result:()=>oe.A,sample:()=>Xe.A,select:()=>Fe.A,shuffle:()=>Ge.A,size:()=>et.A,some:()=>He.A,sortBy:()=>ze.A,sortedIndex:()=>ye.A,tail:()=>ot.A,take:()=>it.A,tap:()=>j.A,template:()=>re.A,templateSettings:()=>ne.A,throttle:()=>_e.A,times:()=>$.A,toArray:()=>$e.A,toPath:()=>K.A,transpose:()=>ht.A,unescape:()=>ie.A,union:()=>At.A,uniq:()=>ut.A,unique:()=>ut.A,uniqueId:()=>ae.A,unzip:()=>ht.A,values:()=>x.A,where:()=>qe.A,without:()=>lt.A,wrap:()=>me.A,zip:()=>ft.A});var i=s(28794),n=s(11508),r=s(44099),o=s(21949),a=s(96734),c=s(85142),l=s(1138),u=s(90573),A=s(72897),p=s(88848),d=s(50093),h=s(82940),f=s(18628),_=s(38993),S=s(84933),m=s(15811),E=s(11380),P=s(66494),O=s(48215),T=s(58855),g=s(32271),N=s(31611),R=s(29143),b=s(71435),y=s(71940),v=s(30296),I=s(95094),U=s(9634),D=s(75144),C=s(88445),x=s(78850),w=s(55895),L=s(38024),F=s(66343),M=s(3080),Y=s(19478),H=s(19318),V=s(50656),k=s(46463),j=s(73323),q=s(63854),W=s(7930),B=s(42687),G=s(69702),X=s(86524),z=s(964),K=s(18398),Z=s(35957),J=s(95048),Q=s(70104),$=s(12672),ee=s(19291),te=s(52414),se=s(20235),ie=s(47868),ne=s(2155),re=s(74394),oe=s(60301),ae=s(64230),ce=s(36503),le=s(48557),ue=s(63015),Ae=s(95619),pe=s(93964),de=s(630),he=s(52933),fe=s(26622),_e=s(58448),Se=s(99527),me=s(62112),Ee=s(66058),Pe=s(81734),Oe=s(86800),Te=s(73939),ge=s(55481),Ne=s(72532),Re=s(80843),be=s(58699),ye=s(43481),ve=s(30899),Ie=s(95379),Ue=s(9671),De=s(22888),Ce=s(79901),xe=s(15928),we=s(68518),Le=s(8606),Fe=s(62478),Me=s(37183),Ye=s(47601),He=s(54580),Ve=s(38973),ke=s(75112),je=s(44339),qe=s(17453),We=s(96624),Be=s(3374),Ge=s(14875),Xe=s(86666),ze=s(74849),Ke=s(30824),Ze=s(43639),Je=s(72232),Qe=s(90268),$e=s(65228),et=s(39005),tt=s(88571),st=s(54585),it=s(42892),nt=s(72826),rt=s(10328),ot=s(59750),at=s(78707),ct=s(72704),lt=s(63182),ut=s(8037),At=s(25981),pt=s(65665),dt=s(14299),ht=s(9176),ft=s(58877),_t=s(85919),St=s(29271),mt=s(84327),Et=s(23991),Pt=s(37643)},95780(e,t,s){var i=s(21777),n=s(70580),r=s.n(n),o=s(74692),a=s.n(o),c=s(36210),l=(s(50082),s(35947));const u=null===(A=(0,i.HW)())?(0,l.YK)().setApp("core").build():(0,l.YK)().setApp("core").setUid(A.uid).build();var A;(0,l.YK)().setApp("unified-search").detectUser().build(),function(e,t){const 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 i=s.PROTOCOL_HTTP+"://";t.useHTTPS&&(i=s.PROTOCOL_HTTPS+"://"),i+=t.host+this._root,this._host=t.host,this._defaultHeaders=t.defaultHeaders||{"X-Requested-With":"XMLHttpRequest",requesttoken:e.requestToken},this._baseUrl=i;const n={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&&(n.userName=t.userName),t.password&&(n.password=t.password),this._client=new dav.Client(n),this._client.xhrProvider=c.A.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,i=s.open;return s.open=function(){const e=i.apply(this,arguments);return c.A.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 i;for(i=0;i<s.length;i++)s[i]=encodeURIComponent(s[i]);return t=s.join("/"),t},_parseHeaders:function(e){const t=e.split("\n"),s={};for(let e=0;e<t.length;e++){const i=t[e].indexOf(":");if(i<0)continue;const n=t[e].substr(0,i),r=t[e].substr(i+2);s[n]||(s[n]=[]),s[n].push(r)}return s},_parseEtag:function(e){return'"'===e.charAt(0)?e.split('"')[1]:e},_parseFileInfo:function(i){let n=decodeURIComponent(i.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===i.propStat.length||"HTTP/1.1 200 OK"!==i.propStat[0].status)return null;const r=i.propStat[0].properties,o={id:r[s.PROPERTY_INTERNAL_FILEID],path:e.dirname(n)||"/",name:e.basename(n),mtime:new Date(r[s.PROPERTY_GETLASTMODIFIED]).getTime()},a=r[s.PROPERTY_GETETAG];c.A.isUndefined(a)||(o.etag=this._parseEtag(a));let l=r[s.PROPERTY_GETCONTENTLENGTH];c.A.isUndefined(l)||(o.size=parseInt(l,10)),l=r[s.PROPERTY_SIZE],c.A.isUndefined(l)||(o.size=parseInt(l,10));const A=r["{"+s.NS_NEXTCLOUD+"}has-preview"];c.A.isUndefined(A)?o.hasPreview=!0:o.hasPreview="true"===A;const p=r["{"+s.NS_NEXTCLOUD+"}is-encrypted"];c.A.isUndefined(p)?o.isEncrypted=!1:o.isEncrypted="1"===p;const d=r["{"+s.NS_OWNCLOUD+"}favorite"];c.A.isUndefined(d)?o.isFavourited=!1:o.isFavourited="1"===d;const h=r[s.PROPERTY_GETCONTENTTYPE];c.A.isUndefined(h)||(o.mimetype=h);const f=r[s.PROPERTY_RESOURCETYPE];if(!o.mimetype&&f){const e=f[0];e.namespaceURI===s.NS_DAV&&"collection"===e.nodeName.split(":")[1]&&(o.mimetype="httpd/unix-directory")}o.permissions=e.PERMISSION_NONE;const _=r[s.PROPERTY_PERMISSIONS];if(!c.A.isUndefined(_)){const t=_||"";o.mountType=null;for(let s=0;s<t.length;s++)switch(t.charAt(s)){case"C":case"K":o.permissions|=e.PERMISSION_CREATE;break;case"G":o.permissions|=e.PERMISSION_READ;break;case"W":case"N":case"V":o.permissions|=e.PERMISSION_UPDATE;break;case"D":o.permissions|=e.PERMISSION_DELETE;break;case"R":o.permissions|=e.PERMISSION_SHARE;break;case"M":o.mountType||(o.mountType="external");break;case"S":o.mountType="shared"}}const S=r[s.PROPERTY_SHARE_PERMISSIONS];c.A.isUndefined(S)||(o.sharePermissions=parseInt(S));const m=r[s.PROPERTY_SHARE_ATTRIBUTES];if(c.A.isUndefined(m))o.shareAttributes=[];else try{o.shareAttributes=JSON.parse(m)}catch{u.warn('Could not parse share attributes returned by server: "'+m+'"'),o.shareAttributes=[]}const E=r["{"+s.NS_NEXTCLOUD+"}mount-type"];c.A.isUndefined(E)||(o.mountType=E);const P=r["{"+s.NS_DAV+"}quota-available-bytes"];return c.A.isUndefined(P)||(o.quotaAvailableBytes=P),c.A.each(this._fileInfoParsers,function(e){c.A.extend(o,e(i,o)||{})}),new t(o)},_parseResult:function(e){const t=this;return c.A.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 i=s.getElementsByTagNameNS("http://sabredav.org/ns","message"),n=s.getElementsByTagNameNS("http://sabredav.org/ns","exception");return i.length&&(t.message=i[0].textContent),n.length&&(t.exception=n[0].textContent),t},getPropfindProperties:function(){return this._propfindProperties||(this._propfindProperties=c.A.map(s._PROPFIND_PROPERTIES,function(e){return"{"+e[0]+"}"+e[1]})),this._propfindProperties},getFolderContents:function(e,t){e||(e=""),t=t||{};const s=this,i=a().Deferred(),n=i.promise();let r;return r=c.A.isUndefined(t.properties)?this.getPropfindProperties():t.properties,this._client.propFind(this._buildUrl(e),r,1).then(function(e){if(s._isSuccessStatus(e.status)){const n=s._parseResult(e.body);t&&t.includeParent||n.shift(),i.resolve(e.status,n)}else e=c.A.extend(e,s._getSabreException(e)),i.reject(e.status,e)}),n},getFilteredFiles:function(e,t){t=t||{};const s=this,i=a().Deferred(),n=i.promise();let o;if(o=c.A.isUndefined(t.properties)?this.getPropfindProperties():t.properties,!e||!e.systemTagIds&&c.A.isUndefined(e.favorite)&&!e.circlesIds)throw"Missing filter argument";let l,u="<oc:filter-files ";for(l in this._client.xmlNamespaces)u+=" xmlns:"+this._client.xmlNamespaces[l]+'="'+l+'"';return u+=">\n",u+=" <"+this._client.xmlNamespaces["DAV:"]+":prop>\n",c.A.each(o,function(e){const 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",c.A.each(e.systemTagIds,function(e){u+=" <oc:systemtag>"+r()(e)+"</oc:systemtag>\n"}),c.A.each(e.circlesIds,function(e){u+=" <oc:circle>"+r()(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)){const t=s._parseResult(e.body);i.resolve(e.status,t)}else e=c.A.extend(e,s._getSabreException(e)),i.reject(e.status,e)}),n},getFileInfo:function(e,t){e||(e=""),t=t||{};const s=this,i=a().Deferred(),n=i.promise();let r;return r=c.A.isUndefined(t.properties)?this.getPropfindProperties():t.properties,this._client.propFind(this._buildUrl(e),r,0).then(function(e){s._isSuccessStatus(e.status)?i.resolve(e.status,s._parseResult([e.body])[0]):(e=c.A.extend(e,s._getSabreException(e)),i.reject(e.status,e))}),n},getFileContents:function(e){if(!e)throw'Missing argument "path"';const t=this,s=a().Deferred(),i=s.promise();return this._client.request("GET",this._buildUrl(e)).then(function(e){t._isSuccessStatus(e.status)?s.resolve(e.status,e.body):(e=c.A.extend(e,t._getSabreException(e)),s.reject(e.status,e))}),i},putFileContents:function(e,t,s){if(!e)throw'Missing argument "path"';const i=this,n=a().Deferred(),r=n.promise(),o={};let l="text/plain;charset=utf-8";return(s=s||{}).contentType&&(l=s.contentType),o["Content-Type"]=l,(c.A.isUndefined(s.overwrite)||s.overwrite)&&(o["If-None-Match"]="*"),this._client.request("PUT",this._buildUrl(e),o,t||"").then(function(e){i._isSuccessStatus(e.status)?n.resolve(e.status):(e=c.A.extend(e,i._getSabreException(e)),n.reject(e.status,e))}),r},_simpleCall:function(e,t,s){if(!t)throw'Missing argument "path"';const i=this,n=a().Deferred(),r=n.promise();return this._client.request(e,this._buildUrl(t),s||{}).then(function(e){i._isSuccessStatus(e.status)?n.resolve(e.status):(e=c.A.extend(e,i._getSabreException(e)),n.reject(e.status,e))}),r},createDirectory:function(e,t){return this._simpleCall("MKCOL",e,t)},remove:function(e){return this._simpleCall("DELETE",e)},move:function(e,t,s,i){if(!e)throw'Missing argument "path"';if(!t)throw'Missing argument "destinationPath"';const n=this,r=a().Deferred(),o=r.promise();return i=c.A.extend({},i,{Destination:this._buildUrl(t)}),s||(i.Overwrite="F"),this._client.request("MOVE",this._buildUrl(e),i).then(function(e){n._isSuccessStatus(e.status)?r.resolve(e.status):(e=c.A.extend(e,n._getSabreException(e)),r.reject(e.status,e))}),o},copy:function(e,t,s){if(!e)throw'Missing argument "path"';if(!t)throw'Missing argument "destinationPath"';const i=this,n=a().Deferred(),r=n.promise(),o={Destination:this._buildUrl(t)};return s||(o.Overwrite="F"),this._client.request("COPY",this._buildUrl(e),o).then(function(e){i._isSuccessStatus(e.status)?n.resolve(e.status):n.reject(e.status)}),r},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:window.location.host,port:window.location.port,root:e.linkToRemoteBase("dav")+"/files/"+(0,i.HW)().uid,useHTTPS:window.location.protocol.startsWith("https")});return e.Files._defaultClient=t,t},e.Files.Client=s}(OC,OC.Files.FileInfo)}},s={};function i(e){var n=s[e];if(void 0!==n)return n.exports;var r=s[e]={id:e,loaded:!1,exports:{}};return t[e].call(r.exports,r,r.exports,i),r.loaded=!0,r.exports}i.m=t,e=[],i.O=(t,s,n,r)=>{if(!s){var o=1/0;for(u=0;u<e.length;u++){for(var[s,n,r]=e[u],a=!0,c=0;c<s.length;c++)(!1&r||o>=r)&&Object.keys(i.O).every(e=>i.O[e](s[c]))?s.splice(c--,1):(a=!1,r<o&&(o=r));if(a){e.splice(u--,1);var l=n();void 0!==l&&(t=l)}}return t}r=r||0;for(var u=e.length;u>0&&e[u-1][2]>r;u--)e[u]=e[u-1];e[u]=[s,n,r]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.e=()=>Promise.resolve(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i.j=590,(()=>{i.b="undefined"!=typeof document&&document.baseURI||self.location.href;var e={590:0};i.O.j=t=>0===e[t];var t=(t,s)=>{var n,r,[o,a,c]=s,l=0;if(o.some(t=>0!==e[t])){for(n in a)i.o(a,n)&&(i.m[n]=a[n]);if(c)var u=c(i)}for(t&&t(s);l<o.length;l++)r=o[l],i.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return i.O(u)},s=globalThis.webpackChunknextcloud_ui_legacy=globalThis.webpackChunknextcloud_ui_legacy||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})(),i.nc=void 0;var n=i.O(void 0,[4208],()=>i(95780));n=i.O(n)})();
|
|
//# sourceMappingURL=core-files_client.js.map?v=ede7f772323c81cd4ac9
|