@opencloud-eu/web-client 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{functions-gLZtPuF8.js → functions-CYOnwClV.js} +131 -130
- package/dist/{functions-BCZphZWf.cjs → functions-DEaUzlbB.cjs} +1 -1
- package/dist/{index-D5plj7J1.cjs → index-B3tdq56F.cjs} +1 -1
- package/dist/index-D3QfKFAH.cjs +1 -0
- package/dist/{index-DRNBPoWu.js → index-DxUgq3ag.js} +1 -1
- package/dist/index-oCdLZPEA.js +699 -0
- package/dist/src/graph/drives/types.d.ts +9 -2
- package/dist/src/graph/generated/api.d.ts +57 -12
- package/dist/src/helpers/space/types.d.ts +1 -0
- package/dist/web-client/graph/generated.cjs +1 -1
- package/dist/web-client/graph/generated.js +1225 -1204
- package/dist/web-client/graph.cjs +1 -1
- package/dist/web-client/graph.js +1 -1
- package/dist/web-client/webdav.cjs +1 -1
- package/dist/web-client/webdav.js +2 -2
- package/dist/web-client.cjs +1 -1
- package/dist/web-client.js +5 -5
- package/package.json +2 -2
- package/dist/index-B0DQP5k7.cjs +0 -1
- package/dist/index-kED1r0rQ.js +0 -693
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Ae=Object.defineProperty;var ye=(e,t,i)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var b=(e,t,i)=>ye(e,typeof t!="symbol"?t+"":t,i);const P=require("./toString-hHr716Th.cjs"),Oe=require("./index-C6VnMvgz.cjs");function ee(e,t=""){return`/public-files/${e}/${t}`.split("/").filter(Boolean).join("/")}function te(e,t=""){return`/ocm/${e}/${t}`.split("/").filter(Boolean).join("/")}var $,B;function Te(){if(B)return $;B=1;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function t(s,n){for(var r="",l=0,c=-1,p=0,u,f=0;f<=s.length;++f){if(f<s.length)u=s.charCodeAt(f);else{if(u===47)break;u=47}if(u===47){if(!(c===f-1||p===1))if(c!==f-1&&p===2){if(r.length<2||l!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var g=r.lastIndexOf("/");if(g!==r.length-1){g===-1?(r="",l=0):(r=r.slice(0,g),l=r.length-1-r.lastIndexOf("/")),c=f,p=0;continue}}else if(r.length===2||r.length===1){r="",l=0,c=f,p=0;continue}}n&&(r.length>0?r+="/..":r="..",l=2)}else r.length>0?r+="/"+s.slice(c+1,f):r=s.slice(c+1,f),l=f-c-1;c=f,p=0}else u===46&&p!==-1?++p:p=-1}return r}function i(s,n){var r=n.dir||n.root,l=n.base||(n.name||"")+(n.ext||"");return r?r===n.root?r+l:r+s+l:l}var d={resolve:function(){for(var n="",r=!1,l,c=arguments.length-1;c>=-1&&!r;c--){var p;c>=0?p=arguments[c]:(l===void 0&&(l=Oe.process$1.cwd()),p=l),e(p),p.length!==0&&(n=p+"/"+n,r=p.charCodeAt(0)===47)}return n=t(n,!r),r?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(n){if(e(n),n.length===0)return".";var r=n.charCodeAt(0)===47,l=n.charCodeAt(n.length-1)===47;return n=t(n,!r),n.length===0&&!r&&(n="."),n.length>0&&l&&(n+="/"),r?"/"+n:n},isAbsolute:function(n){return e(n),n.length>0&&n.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var n,r=0;r<arguments.length;++r){var l=arguments[r];e(l),l.length>0&&(n===void 0?n=l:n+="/"+l)}return n===void 0?".":d.normalize(n)},relative:function(n,r){if(e(n),e(r),n===r||(n=d.resolve(n),r=d.resolve(r),n===r))return"";for(var l=1;l<n.length&&n.charCodeAt(l)===47;++l);for(var c=n.length,p=c-l,u=1;u<r.length&&r.charCodeAt(u)===47;++u);for(var f=r.length,g=f-u,o=p<g?p:g,h=-1,m=0;m<=o;++m){if(m===o){if(g>o){if(r.charCodeAt(u+m)===47)return r.slice(u+m+1);if(m===0)return r.slice(u+m)}else p>o&&(n.charCodeAt(l+m)===47?h=m:m===0&&(h=0));break}var I=n.charCodeAt(l+m),k=r.charCodeAt(u+m);if(I!==k)break;I===47&&(h=m)}var S="";for(m=l+h+1;m<=c;++m)(m===c||n.charCodeAt(m)===47)&&(S.length===0?S+="..":S+="/..");return S.length>0?S+r.slice(u+h):(u+=h,r.charCodeAt(u)===47&&++u,r.slice(u))},_makeLong:function(n){return n},dirname:function(n){if(e(n),n.length===0)return".";for(var r=n.charCodeAt(0),l=r===47,c=-1,p=!0,u=n.length-1;u>=1;--u)if(r=n.charCodeAt(u),r===47){if(!p){c=u;break}}else p=!1;return c===-1?l?"/":".":l&&c===1?"//":n.slice(0,c)},basename:function(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');e(n);var l=0,c=-1,p=!0,u;if(r!==void 0&&r.length>0&&r.length<=n.length){if(r.length===n.length&&r===n)return"";var f=r.length-1,g=-1;for(u=n.length-1;u>=0;--u){var o=n.charCodeAt(u);if(o===47){if(!p){l=u+1;break}}else g===-1&&(p=!1,g=u+1),f>=0&&(o===r.charCodeAt(f)?--f===-1&&(c=u):(f=-1,c=g))}return l===c?c=g:c===-1&&(c=n.length),n.slice(l,c)}else{for(u=n.length-1;u>=0;--u)if(n.charCodeAt(u)===47){if(!p){l=u+1;break}}else c===-1&&(p=!1,c=u+1);return c===-1?"":n.slice(l,c)}},extname:function(n){e(n);for(var r=-1,l=0,c=-1,p=!0,u=0,f=n.length-1;f>=0;--f){var g=n.charCodeAt(f);if(g===47){if(!p){l=f+1;break}continue}c===-1&&(p=!1,c=f+1),g===46?r===-1?r=f:u!==1&&(u=1):r!==-1&&(u=-1)}return r===-1||c===-1||u===0||u===1&&r===c-1&&r===l+1?"":n.slice(r,c)},format:function(n){if(n===null||typeof n!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof n);return i("/",n)},parse:function(n){e(n);var r={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return r;var l=n.charCodeAt(0),c=l===47,p;c?(r.root="/",p=1):p=0;for(var u=-1,f=0,g=-1,o=!0,h=n.length-1,m=0;h>=p;--h){if(l=n.charCodeAt(h),l===47){if(!o){f=h+1;break}continue}g===-1&&(o=!1,g=h+1),l===46?u===-1?u=h:m!==1&&(m=1):u!==-1&&(m=-1)}return u===-1||g===-1||m===0||m===1&&u===g-1&&u===f+1?g!==-1&&(f===0&&c?r.base=r.name=n.slice(1,g):r.base=r.name=n.slice(f,g)):(f===0&&c?(r.name=n.slice(1,u),r.base=n.slice(1,g)):(r.name=n.slice(f,u),r.base=n.slice(f,g)),r.ext=n.slice(u,g)),f>0?r.dir=n.slice(0,f-1):c&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return d.posix=d,$=d,$}var T=Te();const Z=P.getDefaultExportFromCjs(T);class R{}b(R,"Shared","S"),b(R,"Shareable","R"),b(R,"Mounted","M"),b(R,"Deletable","D"),b(R,"Renameable","N"),b(R,"Moveable","V"),b(R,"Updateable","NV"),b(R,"FileUpdateable","W"),b(R,"FolderCreateable","CK"),b(R,"Deny","Z"),b(R,"SecureView","X");var ne=(e=>(e.copy="COPY",e.delete="DELETE",e.lock="LOCK",e.mkcol="MKCOL",e.move="MOVE",e.propfind="PROPFIND",e.proppatch="PROPPATCH",e.put="PUT",e.report="REPORT",e.unlock="UNLOCK",e))(ne||{});const U=e=>({value:e,type:null}),Ue=e=>U(e),v=e=>U(e),M=e=>U(e),Ee=e=>U(e),Fe={Permissions:v("permissions"),IsFavorite:M("favorite"),FileId:v("fileid"),FileParent:v("file-parent"),Name:v("name"),OwnerId:v("owner-id"),OwnerDisplayName:v("owner-display-name"),PrivateLink:v("privatelink"),ContentLength:M("getcontentlength"),ContentSize:M("size"),LastModifiedDate:v("getlastmodified"),Tags:Ue("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:v("getetag"),MimeType:v("getcontenttype"),ResourceType:Ee("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:v("owner"),LockTime:v("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:v("downloadURL"),Highlights:v("highlights"),MetaPathForUser:v("meta-path-for-user"),RemoteItemId:v("remote-item-id"),ShareId:v("shareid"),ShareRoot:v("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:v("share-permissions"),TrashbinOriginalFilename:v("trashbin-original-filename"),TrashbinOriginalLocation:v("trashbin-original-location"),TrashbinDeletedDate:v("trashbin-delete-datetime"),PublicLinkItemType:v("public-link-item-type"),PublicLinkPermission:v("public-link-permission"),PublicLinkExpiration:v("public-link-expiration"),PublicLinkShareDate:v("public-link-share-datetime"),PublicLinkShareOwner:v("public-link-share-owner")},a=Object.fromEntries(Object.entries(Fe).map(([e,t])=>[e,t.value])),L=class L{};b(L,"Default",[a.Permissions,a.IsFavorite,a.FileId,a.FileParent,a.Name,a.LockDiscovery,a.ActiveLock,a.OwnerId,a.OwnerDisplayName,a.RemoteItemId,a.ShareRoot,a.ShareTypes,a.PrivateLink,a.ContentLength,a.ContentSize,a.LastModifiedDate,a.ETag,a.MimeType,a.ResourceType,a.DownloadURL,a.Tags,a.Audio,a.Location,a.Image,a.Photo]),b(L,"PublicLink",L.Default.concat([a.PublicLinkItemType,a.PublicLinkPermission,a.PublicLinkExpiration,a.PublicLinkShareDate,a.PublicLinkShareOwner])),b(L,"Trashbin",[a.ContentLength,a.ResourceType,a.TrashbinOriginalLocation,a.TrashbinOriginalFilename,a.TrashbinDeletedDate,a.Permissions,a.FileParent]),b(L,"DavNamespace",[a.ContentLength,a.LastModifiedDate,a.ETag,a.MimeType,a.ResourceType,a.LockDiscovery,a.ActiveLock]);let N=L;function re(e){return e}function $e(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}var Me=800,Ne=16,je=Date.now;function ze(e){var t=0,i=0;return function(){var d=je(),s=Ne-(d-i);if(i=d,s>0){if(++t>=Me)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function We(e){return function(){return e}}var q=function(){try{var e=P.getNative(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Ve=q?function(e,t){return q(e,"toString",{configurable:!0,enumerable:!1,value:We(t),writable:!0})}:re,Je=ze(Ve);function He(e,t,i,d){for(var s=e.length,n=i+-1;++n<s;)if(t(e[n],n,e))return n;return-1}function _e(e){return e!==e}function Be(e,t,i){for(var d=i-1,s=e.length;++d<s;)if(e[d]===t)return d;return-1}function Ze(e,t,i){return t===t?Be(e,t,i):He(e,_e,i)}function ie(e,t){var i=e==null?0:e.length;return!!i&&Ze(e,t,0)>-1}var K=Math.max;function qe(e,t,i){return t=K(t===void 0?e.length-1:t,0),function(){for(var d=arguments,s=-1,n=K(d.length-t,0),r=Array(n);++s<n;)r[s]=d[t+s];s=-1;for(var l=Array(t+1);++s<t;)l[s]=d[s];return l[t]=i(r),$e(e,this,l)}}function Ke(e,t){return Je(qe(e,t,re),e+"")}var Ye=9007199254740991;function Qe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ye}function Xe(e){return e!=null&&Qe(e.length)&&!P.isFunction(e)}function Ge(e,t,i){var d=-1,s=e.length;t<0&&(t=-t>s?0:s+t),i=i>s?s:i,i<0&&(i+=s),s=t>i?0:i-t>>>0,t>>>=0;for(var n=Array(s);++d<s;)n[d]=e[d+t];return n}function et(e,t,i){var d=e.length;return i=i===void 0?d:i,Ge(e,t,i)}var tt="\\ud800-\\udfff",nt="\\u0300-\\u036f",rt="\\ufe20-\\ufe2f",it="\\u20d0-\\u20ff",at=nt+rt+it,st="\\ufe0e\\ufe0f",ot="\\u200d",ut=RegExp("["+ot+tt+at+st+"]");function ae(e){return ut.test(e)}function lt(e){return e.split("")}var se="\\ud800-\\udfff",ct="\\u0300-\\u036f",dt="\\ufe20-\\ufe2f",ft="\\u20d0-\\u20ff",pt=ct+dt+ft,ht="\\ufe0e\\ufe0f",gt="["+se+"]",j="["+pt+"]",z="\\ud83c[\\udffb-\\udfff]",mt="(?:"+j+"|"+z+")",oe="[^"+se+"]",ue="(?:\\ud83c[\\udde6-\\uddff]){2}",le="[\\ud800-\\udbff][\\udc00-\\udfff]",bt="\\u200d",ce=mt+"?",de="["+ht+"]?",vt="(?:"+bt+"(?:"+[oe,ue,le].join("|")+")"+de+ce+")*",xt=de+ce+vt,Rt="(?:"+[oe+j+"?",j,ue,le,gt].join("|")+")",Pt=RegExp(z+"(?="+z+")|"+Rt+xt,"g");function Dt(e){return e.match(Pt)||[]}function It(e){return ae(e)?Dt(e):lt(e)}function St(e){return function(t){t=P.toString(t);var i=ae(t)?It(t):void 0,d=i?i[0]:t.charAt(0),s=i?et(i,1).join(""):t.slice(1);return d[e]()+s}}var Lt=St("toUpperCase");function kt(e){return Lt(P.toString(e).toLowerCase())}function wt(e,t,i,d){for(var s=-1,n=e==null?0:e.length;++s<n;)i=t(i,e[s],s,e);return i}function Ct(e){return function(t){return e==null?void 0:e[t]}}var At={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},yt=Ct(At),Ot=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tt="\\u0300-\\u036f",Ut="\\ufe20-\\ufe2f",Et="\\u20d0-\\u20ff",Ft=Tt+Ut+Et,$t="["+Ft+"]",Mt=RegExp($t,"g");function Nt(e){return e=P.toString(e),e&&e.replace(Ot,yt).replace(Mt,"")}var jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function zt(e){return e.match(jt)||[]}var Wt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Vt(e){return Wt.test(e)}var fe="\\ud800-\\udfff",Jt="\\u0300-\\u036f",Ht="\\ufe20-\\ufe2f",_t="\\u20d0-\\u20ff",Bt=Jt+Ht+_t,pe="\\u2700-\\u27bf",he="a-z\\xdf-\\xf6\\xf8-\\xff",Zt="\\xac\\xb1\\xd7\\xf7",qt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Kt="\\u2000-\\u206f",Yt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ge="A-Z\\xc0-\\xd6\\xd8-\\xde",Qt="\\ufe0e\\ufe0f",me=Zt+qt+Kt+Yt,be="['’]",Y="["+me+"]",Xt="["+Bt+"]",ve="\\d+",Gt="["+pe+"]",xe="["+he+"]",Re="[^"+fe+me+ve+pe+he+ge+"]",en="\\ud83c[\\udffb-\\udfff]",tn="(?:"+Xt+"|"+en+")",nn="[^"+fe+"]",Pe="(?:\\ud83c[\\udde6-\\uddff]){2}",De="[\\ud800-\\udbff][\\udc00-\\udfff]",w="["+ge+"]",rn="\\u200d",Q="(?:"+xe+"|"+Re+")",an="(?:"+w+"|"+Re+")",X="(?:"+be+"(?:d|ll|m|re|s|t|ve))?",G="(?:"+be+"(?:D|LL|M|RE|S|T|VE))?",Ie=tn+"?",Se="["+Qt+"]?",sn="(?:"+rn+"(?:"+[nn,Pe,De].join("|")+")"+Se+Ie+")*",on="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",un="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ln=Se+Ie+sn,cn="(?:"+[Gt,Pe,De].join("|")+")"+ln,dn=RegExp([w+"?"+xe+"+"+X+"(?="+[Y,w,"$"].join("|")+")",an+"+"+G+"(?="+[Y,w+Q,"$"].join("|")+")",w+"?"+Q+"+"+X,w+"+"+G,un,on,ve,cn].join("|"),"g");function fn(e){return e.match(dn)||[]}function pn(e,t,i){return e=P.toString(e),t=t,t===void 0?Vt(e)?fn(e):zt(e):e.match(t)||[]}var hn="['’]",gn=RegExp(hn,"g");function mn(e){return function(t){return wt(pn(Nt(t).replace(gn,"")),e,"")}}var bn=mn(function(e,t,i){return t=t.toLowerCase(),e+(i?kt(t):t)}),vn="__lodash_hash_undefined__";function xn(e){return this.__data__.set(e,vn),this}function Rn(e){return this.__data__.has(e)}function y(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new P.MapCache;++t<i;)this.add(e[t])}y.prototype.add=y.prototype.push=xn;y.prototype.has=Rn;function W(e,t){return e.has(t)}function Pn(e){return P.isObjectLike(e)&&Xe(e)}var Dn=Math.min;function In(e,t,i){for(var d=ie,s=e[0].length,n=e.length,r=n,l=Array(n),c=1/0,p=[];r--;){var u=e[r];c=Dn(u.length,c),l[r]=s>=120&&u.length>=120?new y(r&&u):void 0}u=e[0];var f=-1,g=l[0];e:for(;++f<s&&p.length<c;){var o=u[f],h=o;if(o=o!==0?o:0,!(g?W(g,h):d(p,h))){for(r=n;--r;){var m=l[r];if(!(m?W(m,h):d(e[r],h)))continue e}g&&g.push(h),p.push(o)}}return p}function Sn(e){return Pn(e)?e:[]}var Ln=Ke(function(e){var t=P.arrayMap(e,Sn);return t.length&&t[0]===e[0]?In(t):[]});const kn={complex:["tar.bz2","tar.gz","tar.xz"]},wn=e=>Object.hasOwn(e,"ddate"),Cn=e=>Object.hasOwn(e,"highlights"),E=e=>e.replace(/[^A-Za-z0-9\-_]/g,""),Le=(e,t)=>!e||typeof e!="string"?"":e.indexOf("!")>=0?e.split("!")[t]:"",ke=e=>Le(e,0),H=e=>Le(e,1),An=e=>{const t=e.extension||"",i=e.name||"";if(!t.length)return i;const d=i.lastIndexOf(`.${t}`);return i.substring(0,d)},F=e=>{const t=e.name;if(e.type==="directory"||e.isFolder)return"";const i=t.split(".");if(i.length>2)for(let d=0;d<i.length;d++){const s=i.slice(d,i.length).join(".");if(kn.complex.includes(s))return s}return i.length<2?"":i[i.length-1]},yn=e=>T.basename(T.dirname(e.path))||null,On=e=>typeof e.isShareRoot=="function"&&e.isShareRoot(),O=e=>{if(!e)return e;const t={};return Object.keys(e).forEach(i=>{t[bn(i)]=e[i]}),t};function Tn(e,t=[]){var h,m,I;const i=((h=e.props[a.Name])==null?void 0:h.toString())||T.basename(e.filename),d=e.props[a.FileId],s=e.type==="directory";let n;e.filename.startsWith("/files")||e.filename.startsWith("/space")?n=e.filename.split("/").slice(3).join("/"):n=e.filename,n.startsWith("/")||(n=`/${n}`);const r=F({...e,name:i}),l=e.props[a.LockDiscovery];let c,p,u;l&&(c=l[a.ActiveLock],p=c[a.LockOwner],u=c[a.LockTime]);let f=[];e.props[a.ShareTypes]&&(f=e.props[a.ShareTypes]["share-type"],Array.isArray(f)||(f=[f]));const g={};for(const k of t||[]){const S=k.split(":").pop();e.props[S]&&(g[k]=e.props[S])}const o={id:d,fileId:d,storageId:ke(d),parentFolderId:e.props[a.FileParent],mimeType:e.props[a.MimeType],name:i,extension:s?"":r,path:n,webDavPath:e.filename,type:s?"folder":e.type,isFolder:s,locked:!!c,lockOwner:p,lockTime:u,processing:e.processing||!1,mdate:e.props[a.LastModifiedDate],size:s?((m=e.props[a.ContentSize])==null?void 0:m.toString())||"0":((I=e.props[a.ContentLength])==null?void 0:I.toString())||"0",permissions:e.props[a.Permissions]||"",starred:e.props[a.IsFavorite]!==0,etag:e.props[a.ETag],shareTypes:f,privateLink:e.props[a.PrivateLink],downloadURL:e.props[a.DownloadURL],remoteItemId:e.props[a.RemoteItemId],remoteItemPath:e.props[a.ShareRoot],owner:{id:e.props[a.OwnerId],displayName:e.props[a.OwnerDisplayName]},tags:(e.props[a.Tags]||"").toString().split(",").filter(Boolean),audio:O(e.props[a.Audio]),location:O(e.props[a.Location]),image:O(e.props[a.Image]),photo:O(e.props[a.Photo]),extraProps:g,canUpload:function(){return this.permissions.indexOf(R.FolderCreateable)>=0},canDownload:function(){return this.permissions.indexOf(R.SecureView)===-1},canBeDeleted:function(){return this.permissions.indexOf(R.Deletable)>=0},canRename:function(){return this.permissions.indexOf(R.Renameable)>=0},canShare:function({ability:k}){return k.can("create-all","Share")&&this.permissions.indexOf(R.Shareable)>=0},canCreate:function(){return this.permissions.indexOf(R.FolderCreateable)>=0},canEditTags:function(){return this.permissions.indexOf(R.Updateable)>=0||this.permissions.indexOf(R.FileUpdateable)>=0},isMounted:function(){return this.permissions.indexOf(R.Mounted)>=0},isReceivedShare:function(){return this.permissions.indexOf(R.Shared)>=0},isShareRoot(){return e.props[a.ShareRoot]?e.filename.split("/").length===3:!1},canDeny:function(){return this.permissions.indexOf(R.Deny)>=0},getDomSelector:()=>E(d)};return Object.defineProperty(o,"nodeId",{get(){return H(this.id)}}),o}function Un(e){var n;const t=e.type==="directory",i=(n=e.props[a.TrashbinOriginalFilename])==null?void 0:n.toString(),d=F({name:i,type:e.type}),s=Z.basename(e.filename);return{type:t?"folder":e.type,isFolder:t,ddate:e.props[a.TrashbinDeletedDate],name:Z.basename(i),extension:d,path:P.urlJoin(e.props[a.TrashbinOriginalLocation],{leadingSlash:!0}),id:s,parentFolderId:e.props[a.FileParent],webDavPath:"",canUpload:()=>!1,canDownload:()=>!1,canBeDeleted:()=>!0,canBeRestored:function(){return!0},canRename:()=>!1,canShare:()=>!1,canCreate:()=>!1,isMounted:()=>!1,isReceivedShare:()=>!1,getDomSelector:()=>E(s)}}var D=(e=>(e.createUpload="libre.graph/driveItem/upload/create",e.createPermissions="libre.graph/driveItem/permissions/create",e.createChildren="libre.graph/driveItem/children/create",e.readBasic="libre.graph/driveItem/basic/read",e.readPath="libre.graph/driveItem/path/read",e.readQuota="libre.graph/driveItem/quota/read",e.readContent="libre.graph/driveItem/content/read",e.readChildren="libre.graph/driveItem/children/read",e.readDeleted="libre.graph/driveItem/deleted/read",e.readPermissions="libre.graph/driveItem/permissions/read",e.readVersions="libre.graph/driveItem/versions/read",e.updatePath="libre.graph/driveItem/path/update",e.updateDeleted="libre.graph/driveItem/deleted/update",e.updatePermissions="libre.graph/driveItem/permissions/update",e.updateVersions="libre.graph/driveItem/versions/update",e.deleteStandard="libre.graph/driveItem/standard/delete",e.deleteDeleted="libre.graph/driveItem/deleted/delete",e.deletePermissions="libre.graph/driveItem/permissions/delete",e))(D||{});const A=e=>e;class C{constructor(t,i,d,s){b(this,"_key");b(this,"_value");b(this,"_label");b(this,"_icon");this._key=t,this._value=i,this._label=d,this._icon=s}get key(){return this._key}get value(){return this._value}get label(){return this._label}get icon(){return this._icon}}const x=class x{static isIndividual(t){return this.individuals.includes(t)}static isCollective(t){return this.collectives.includes(t)}static isUnauthenticated(t){return this.unauthenticated.includes(t)}static isAuthenticated(t){return this.authenticated.includes(t)}static getByValue(t){return this.all.find(i=>i.value===t)}static getByValues(t){return t.map(i=>this.getByValue(i))}static getByKeys(t){return t.map(i=>this.all.find(d=>d.key===i))}static getValues(t){return t.map(i=>i.value)}static containsAnyValue(t,i){return Ln(this.getValues(t),i).length>0}};b(x,"user",new C("user",0,A("User"),"user")),b(x,"group",new C("group",1,A("Group"),"group")),b(x,"link",new C("link",3,A("Link"),"link")),b(x,"guest",new C("guest",4,A("Guest"),"global")),b(x,"remote",new C("remote",6,A("External"),"earth")),b(x,"individuals",[x.user,x.guest,x.remote]),b(x,"collectives",[x.group]),b(x,"unauthenticated",[x.link]),b(x,"authenticated",[x.user,x.group,x.guest,x.remote]),b(x,"all",[x.user,x.group,x.link,x.guest,x.remote]);let V=x;const En="a0ca6a90-a365-4782-871e-d44447bbc668",Fn="89f37a33-858b-45fa-8890-a1f2b27d90e1",$n=e=>(e==null?void 0:e.type)==="space",J=e=>(e==null?void 0:e.driveType)==="personal",Mn=e=>(e==null?void 0:e.driveType)==="project",Nn=e=>(e==null?void 0:e.driveType)==="share",jn=e=>(e==null?void 0:e.driveType)==="mountpoint",zn=e=>(e==null?void 0:e.driveType)==="public";function we(e,t){return P.urlJoin("spaces",e,t,{leadingSlash:!0})}function Ce(e,t=""){return P.urlJoin("spaces","trash-bin",e,t,{leadingSlash:!0})}function Wn(e,t){const d=e[{image:"spaceImageData",readme:"spaceReadmeData"}[t]];if(!d)return"";const s=decodeURI(d.webDavUrl).split("/"),n=s.find(r=>r.startsWith(e.id));return n?s.slice(s.indexOf(n)+1).join("/"):""}function Vn(e){return e.permissions.includes(D.deletePermissions)}function Jn(e){var f,g,o,h,m,I;const t=e.publicLinkPassword,i=(f=e.props)==null?void 0:f[a.FileId],d=(g=e.props)==null?void 0:g[a.PublicLinkItemType],s=(o=e.props)==null?void 0:o[a.PublicLinkPermission],n=(h=e.props)==null?void 0:h[a.PublicLinkExpiration],r=(m=e.props)==null?void 0:m[a.PublicLinkShareDate],l=(I=e.props)==null?void 0:I[a.PublicLinkShareOwner],c=e.publicLinkType;let p,u;return c==="ocm"?(p=`ocm/${e.id}`,u=te(e.id)):(p=`public/${e.id}`,u=ee(e.id)),Object.assign(_({...e,driveType:"public",driveAlias:p,webDavPath:u}),{...i&&{fileId:i},...t&&{publicLinkPassword:t},...d&&{publicLinkItemType:d},...s&&{publicLinkPermission:parseInt(s)},...n&&{publicLinkExpiration:n},...r&&{publicLinkShareDate:r},...l&&{publicLinkShareOwner:l},publicLinkType:c})}function Hn({driveAliasPrefix:e,id:t,shareName:i,serverUrl:d}){const s=_({id:t,driveAlias:`${e}/${i}`,driveType:"share",name:i,serverUrl:d});return s.rename=n=>{s.driveAlias=`${e}/${n}`,s.name=n},s}function _(e){var p,u,f,g;let t,i;e.special&&(t=e.special.find(o=>o.specialFolder.name==="image"),i=e.special.find(o=>o.specialFolder.name==="readme"),t&&(t.webDavUrl=decodeURI(t.webDavUrl)),i&&(i.webDavUrl=decodeURI(i.webDavUrl)));const d=((u=(p=e.root)==null?void 0:p.deleted)==null?void 0:u.state)==="trashed",s=P.urlJoin(e.webDavPath||we(e.id),{leadingSlash:!0}),n=P.urlJoin(e.serverUrl,"remote.php/dav",s),r=P.urlJoin(e.webDavTrashPath||Ce(e.id),{leadingSlash:!0}),l=P.urlJoin(e.serverUrl,"remote.php/dav",r),c={id:e.id,fileId:e.id,storageId:e.id,mimeType:"",name:e.name,description:e.description,extension:"",path:"/",webDavPath:s,webDavTrashPath:r,driveAlias:e.driveAlias,driveType:e.driveType,type:"space",isFolder:!0,mdate:e.lastModifiedDateTime,size:((f=e.quota)==null?void 0:f.used)||0,tags:[],permissions:"",starred:!1,etag:"",shareTypes:[],privateLink:e.webUrl,downloadURL:"",owner:(g=e.owner)==null?void 0:g.user,disabled:d,root:e.root,spaceQuota:e.quota,spaceImageData:t,spaceReadmeData:i,graphPermissions:void 0,canUpload:function({user:o}={}){var h;return J(this)&&this.isOwner(o)?!0:(h=this.graphPermissions)==null?void 0:h.includes(D.createUpload)},canDownload:function(){return!0},canBeDeleted:function({ability:o}={}){var h;return this.disabled?o!=null&&o.can("delete-all","Drive")?!0:(h=this.graphPermissions)==null?void 0:h.includes(D.deletePermissions):!1},canRename:function({ability:o}={}){var h;return o!=null&&o.can("update-all","Drive")?!0:(h=this.graphPermissions)==null?void 0:h.includes(D.deletePermissions)},canEditDescription:function({ability:o}={}){var h;return o!=null&&o.can("update-all","Drive")?!0:(h=this.graphPermissions)==null?void 0:h.includes(D.deletePermissions)},canRestore:function({ability:o}={}){var h;return this.disabled?o!=null&&o.can("update-all","Drive")?!0:(h=this.graphPermissions)==null?void 0:h.includes(D.deletePermissions):!1},canDisable:function({ability:o}={}){var h;return this.disabled?!1:o!=null&&o.can("delete-all","Drive")?!0:(h=this.graphPermissions)==null?void 0:h.includes(D.deletePermissions)},canShare:function(){var o;return(o=this.graphPermissions)==null?void 0:o.includes(D.createPermissions)},canEditImage:function(){var o;return this.disabled?!1:(o=this.graphPermissions)==null?void 0:o.includes(D.deletePermissions)},canEditReadme:function(){var o;return this.disabled?!1:(o=this.graphPermissions)==null?void 0:o.includes(D.deletePermissions)},canRestoreFromTrashbin:function(){var o;return(o=this.graphPermissions)==null?void 0:o.includes(D.updateDeleted)},canDeleteFromTrashBin:function(){var o;return(o=this.graphPermissions)==null?void 0:o.includes(D.deletePermissions)},canListVersions:function({user:o}={}){var h;return J(this)&&this.isOwner(o)?!0:(h=this.graphPermissions)==null?void 0:h.includes(D.readVersions)},canCreate:function(){return!0},canEditTags:function(){return!1},isMounted:function(){return!0},isReceivedShare:function(){return!1},isShareRoot:function(){return["share","mountpoint","public"].includes(e.driveType)},canDeny:()=>!1,getDomSelector:()=>E(e.id),getDriveAliasAndItem({path:o}){return P.urlJoin(this.driveAlias,o,{leadingSlash:!1})},getWebDavUrl({path:o}){return P.urlJoin(n,o)},getWebDavTrashUrl({path:o}){return P.urlJoin(l,o)},isOwner(o){var h;return(o==null?void 0:o.id)===((h=this.owner)==null?void 0:h.id)}};return Object.defineProperty(c,"nodeId",{get(){return H(this.id)}}),c}function _n(e){return{id:e.spaceImageData.id,name:e.spaceImageData.name,etag:e.spaceImageData.eTag,extension:F({name:e.spaceImageData.name}),mimeType:e.spaceImageData.file.mimeType,type:"file",webDavPath:P.urlJoin(e.webDavPath,".space",e.spaceImageData.name),canDownload:()=>!0}}exports.DavMethod=ne;exports.DavPermission=R;exports.DavProperties=N;exports.DavProperty=a;exports.GraphSharePermission=D;exports.OCM_PROVIDER_ID=Fn;exports.SHARE_JAIL_ID=En;exports.SetCache=y;exports.ShareType=C;exports.ShareTypes=V;exports.arrayIncludes=ie;exports.buildDeletedResource=Un;exports.buildPublicSpaceResource=Jn;exports.buildResource=Tn;exports.buildShareSpaceResource=Hn;exports.buildSpace=_;exports.buildSpaceImageResource=_n;exports.buildWebDavOcmPath=te;exports.buildWebDavPublicPath=ee;exports.buildWebDavSpacesPath=we;exports.buildWebDavSpacesTrashPath=Ce;exports.cacheHas=W;exports.extractDomSelector=E;exports.extractExtensionFromFile=F;exports.extractNameWithoutExtension=An;exports.extractNodeId=H;exports.extractParentFolderName=yn;exports.extractStorageId=ke;exports.getRelativeSpecialFolderSpacePath=Wn;exports.isManager=Vn;exports.isMountPointSpaceResource=jn;exports.isPersonalSpaceResource=J;exports.isProjectSpaceResource=Mn;exports.isPublicSpaceResource=zn;exports.isSearchResource=Cn;exports.isShareRoot=On;exports.isShareSpaceResource=Nn;exports.isSpaceResource=$n;exports.isTrashResource=wn;
|
|
1
|
+
"use strict";var Ae=Object.defineProperty;var Oe=(e,t,i)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var b=(e,t,i)=>Oe(e,typeof t!="symbol"?t+"":t,i);const P=require("./toString-hHr716Th.cjs"),ye=require("./index-C6VnMvgz.cjs");function ee(e,t=""){return`/public-files/${e}/${t}`.split("/").filter(Boolean).join("/")}function te(e,t=""){return`/ocm/${e}/${t}`.split("/").filter(Boolean).join("/")}var M,B;function Te(){if(B)return M;B=1;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function t(s,n){for(var r="",l=0,c=-1,h=0,u,p=0;p<=s.length;++p){if(p<s.length)u=s.charCodeAt(p);else{if(u===47)break;u=47}if(u===47){if(!(c===p-1||h===1))if(c!==p-1&&h===2){if(r.length<2||l!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var g=r.lastIndexOf("/");if(g!==r.length-1){g===-1?(r="",l=0):(r=r.slice(0,g),l=r.length-1-r.lastIndexOf("/")),c=p,h=0;continue}}else if(r.length===2||r.length===1){r="",l=0,c=p,h=0;continue}}n&&(r.length>0?r+="/..":r="..",l=2)}else r.length>0?r+="/"+s.slice(c+1,p):r=s.slice(c+1,p),l=p-c-1;c=p,h=0}else u===46&&h!==-1?++h:h=-1}return r}function i(s,n){var r=n.dir||n.root,l=n.base||(n.name||"")+(n.ext||"");return r?r===n.root?r+l:r+s+l:l}var d={resolve:function(){for(var n="",r=!1,l,c=arguments.length-1;c>=-1&&!r;c--){var h;c>=0?h=arguments[c]:(l===void 0&&(l=ye.process$1.cwd()),h=l),e(h),h.length!==0&&(n=h+"/"+n,r=h.charCodeAt(0)===47)}return n=t(n,!r),r?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(n){if(e(n),n.length===0)return".";var r=n.charCodeAt(0)===47,l=n.charCodeAt(n.length-1)===47;return n=t(n,!r),n.length===0&&!r&&(n="."),n.length>0&&l&&(n+="/"),r?"/"+n:n},isAbsolute:function(n){return e(n),n.length>0&&n.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var n,r=0;r<arguments.length;++r){var l=arguments[r];e(l),l.length>0&&(n===void 0?n=l:n+="/"+l)}return n===void 0?".":d.normalize(n)},relative:function(n,r){if(e(n),e(r),n===r||(n=d.resolve(n),r=d.resolve(r),n===r))return"";for(var l=1;l<n.length&&n.charCodeAt(l)===47;++l);for(var c=n.length,h=c-l,u=1;u<r.length&&r.charCodeAt(u)===47;++u);for(var p=r.length,g=p-u,o=h<g?h:g,f=-1,m=0;m<=o;++m){if(m===o){if(g>o){if(r.charCodeAt(u+m)===47)return r.slice(u+m+1);if(m===0)return r.slice(u+m)}else h>o&&(n.charCodeAt(l+m)===47?f=m:m===0&&(f=0));break}var D=n.charCodeAt(l+m),k=r.charCodeAt(u+m);if(D!==k)break;D===47&&(f=m)}var S="";for(m=l+f+1;m<=c;++m)(m===c||n.charCodeAt(m)===47)&&(S.length===0?S+="..":S+="/..");return S.length>0?S+r.slice(u+f):(u+=f,r.charCodeAt(u)===47&&++u,r.slice(u))},_makeLong:function(n){return n},dirname:function(n){if(e(n),n.length===0)return".";for(var r=n.charCodeAt(0),l=r===47,c=-1,h=!0,u=n.length-1;u>=1;--u)if(r=n.charCodeAt(u),r===47){if(!h){c=u;break}}else h=!1;return c===-1?l?"/":".":l&&c===1?"//":n.slice(0,c)},basename:function(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');e(n);var l=0,c=-1,h=!0,u;if(r!==void 0&&r.length>0&&r.length<=n.length){if(r.length===n.length&&r===n)return"";var p=r.length-1,g=-1;for(u=n.length-1;u>=0;--u){var o=n.charCodeAt(u);if(o===47){if(!h){l=u+1;break}}else g===-1&&(h=!1,g=u+1),p>=0&&(o===r.charCodeAt(p)?--p===-1&&(c=u):(p=-1,c=g))}return l===c?c=g:c===-1&&(c=n.length),n.slice(l,c)}else{for(u=n.length-1;u>=0;--u)if(n.charCodeAt(u)===47){if(!h){l=u+1;break}}else c===-1&&(h=!1,c=u+1);return c===-1?"":n.slice(l,c)}},extname:function(n){e(n);for(var r=-1,l=0,c=-1,h=!0,u=0,p=n.length-1;p>=0;--p){var g=n.charCodeAt(p);if(g===47){if(!h){l=p+1;break}continue}c===-1&&(h=!1,c=p+1),g===46?r===-1?r=p:u!==1&&(u=1):r!==-1&&(u=-1)}return r===-1||c===-1||u===0||u===1&&r===c-1&&r===l+1?"":n.slice(r,c)},format:function(n){if(n===null||typeof n!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof n);return i("/",n)},parse:function(n){e(n);var r={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return r;var l=n.charCodeAt(0),c=l===47,h;c?(r.root="/",h=1):h=0;for(var u=-1,p=0,g=-1,o=!0,f=n.length-1,m=0;f>=h;--f){if(l=n.charCodeAt(f),l===47){if(!o){p=f+1;break}continue}g===-1&&(o=!1,g=f+1),l===46?u===-1?u=f:m!==1&&(m=1):u!==-1&&(m=-1)}return u===-1||g===-1||m===0||m===1&&u===g-1&&u===p+1?g!==-1&&(p===0&&c?r.base=r.name=n.slice(1,g):r.base=r.name=n.slice(p,g)):(p===0&&c?(r.name=n.slice(1,u),r.base=n.slice(1,g)):(r.name=n.slice(p,u),r.base=n.slice(p,g)),r.ext=n.slice(u,g)),p>0?r.dir=n.slice(0,p-1):c&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return d.posix=d,M=d,M}var U=Te();const Z=P.getDefaultExportFromCjs(U);class R{}b(R,"Shared","S"),b(R,"Shareable","R"),b(R,"Mounted","M"),b(R,"Deletable","D"),b(R,"Renameable","N"),b(R,"Moveable","V"),b(R,"Updateable","NV"),b(R,"FileUpdateable","W"),b(R,"FolderCreateable","CK"),b(R,"Deny","Z"),b(R,"SecureView","X");var ne=(e=>(e.copy="COPY",e.delete="DELETE",e.lock="LOCK",e.mkcol="MKCOL",e.move="MOVE",e.propfind="PROPFIND",e.proppatch="PROPPATCH",e.put="PUT",e.report="REPORT",e.unlock="UNLOCK",e))(ne||{});const E=e=>({value:e,type:null}),Ue=e=>E(e),v=e=>E(e),N=e=>E(e),Ee=e=>E(e),Fe={Permissions:v("permissions"),IsFavorite:N("favorite"),FileId:v("fileid"),FileParent:v("file-parent"),Name:v("name"),OwnerId:v("owner-id"),OwnerDisplayName:v("owner-display-name"),PrivateLink:v("privatelink"),ContentLength:N("getcontentlength"),ContentSize:N("size"),LastModifiedDate:v("getlastmodified"),Tags:Ue("tags"),Audio:{value:"audio",type:null},Location:{value:"location",type:null},Image:{value:"image",type:null},Photo:{value:"photo",type:null},ETag:v("getetag"),MimeType:v("getcontenttype"),ResourceType:Ee("resourcetype"),LockDiscovery:{value:"lockdiscovery",type:null},LockOwner:v("owner"),LockTime:v("locktime"),ActiveLock:{value:"activelock",type:null},DownloadURL:v("downloadURL"),Highlights:v("highlights"),MetaPathForUser:v("meta-path-for-user"),RemoteItemId:v("remote-item-id"),ShareId:v("shareid"),ShareRoot:v("shareroot"),ShareTypes:{value:"share-types",type:null},SharePermissions:v("share-permissions"),TrashbinOriginalFilename:v("trashbin-original-filename"),TrashbinOriginalLocation:v("trashbin-original-location"),TrashbinDeletedDate:v("trashbin-delete-datetime"),PublicLinkItemType:v("public-link-item-type"),PublicLinkPermission:v("public-link-permission"),PublicLinkExpiration:v("public-link-expiration"),PublicLinkShareDate:v("public-link-share-datetime"),PublicLinkShareOwner:v("public-link-share-owner")},a=Object.fromEntries(Object.entries(Fe).map(([e,t])=>[e,t.value])),L=class L{};b(L,"Default",[a.Permissions,a.IsFavorite,a.FileId,a.FileParent,a.Name,a.LockDiscovery,a.ActiveLock,a.OwnerId,a.OwnerDisplayName,a.RemoteItemId,a.ShareRoot,a.ShareTypes,a.PrivateLink,a.ContentLength,a.ContentSize,a.LastModifiedDate,a.ETag,a.MimeType,a.ResourceType,a.DownloadURL,a.Tags,a.Audio,a.Location,a.Image,a.Photo]),b(L,"PublicLink",L.Default.concat([a.PublicLinkItemType,a.PublicLinkPermission,a.PublicLinkExpiration,a.PublicLinkShareDate,a.PublicLinkShareOwner])),b(L,"Trashbin",[a.ContentLength,a.ResourceType,a.TrashbinOriginalLocation,a.TrashbinOriginalFilename,a.TrashbinDeletedDate,a.Permissions,a.FileParent]),b(L,"DavNamespace",[a.ContentLength,a.LastModifiedDate,a.ETag,a.MimeType,a.ResourceType,a.LockDiscovery,a.ActiveLock]);let j=L;function re(e){return e}function $e(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}var Me=800,Ne=16,je=Date.now;function ze(e){var t=0,i=0;return function(){var d=je(),s=Ne-(d-i);if(i=d,s>0){if(++t>=Me)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function We(e){return function(){return e}}var q=function(){try{var e=P.getNative(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Ve=q?function(e,t){return q(e,"toString",{configurable:!0,enumerable:!1,value:We(t),writable:!0})}:re,Je=ze(Ve);function He(e,t,i,d){for(var s=e.length,n=i+-1;++n<s;)if(t(e[n],n,e))return n;return-1}function _e(e){return e!==e}function Be(e,t,i){for(var d=i-1,s=e.length;++d<s;)if(e[d]===t)return d;return-1}function Ze(e,t,i){return t===t?Be(e,t,i):He(e,_e,i)}function ie(e,t){var i=e==null?0:e.length;return!!i&&Ze(e,t,0)>-1}var K=Math.max;function qe(e,t,i){return t=K(t===void 0?e.length-1:t,0),function(){for(var d=arguments,s=-1,n=K(d.length-t,0),r=Array(n);++s<n;)r[s]=d[t+s];s=-1;for(var l=Array(t+1);++s<t;)l[s]=d[s];return l[t]=i(r),$e(e,this,l)}}function Ke(e,t){return Je(qe(e,t,re),e+"")}var Ye=9007199254740991;function Qe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ye}function Xe(e){return e!=null&&Qe(e.length)&&!P.isFunction(e)}function Ge(e,t,i){var d=-1,s=e.length;t<0&&(t=-t>s?0:s+t),i=i>s?s:i,i<0&&(i+=s),s=t>i?0:i-t>>>0,t>>>=0;for(var n=Array(s);++d<s;)n[d]=e[d+t];return n}function et(e,t,i){var d=e.length;return i=i===void 0?d:i,Ge(e,t,i)}var tt="\\ud800-\\udfff",nt="\\u0300-\\u036f",rt="\\ufe20-\\ufe2f",it="\\u20d0-\\u20ff",at=nt+rt+it,st="\\ufe0e\\ufe0f",ot="\\u200d",ut=RegExp("["+ot+tt+at+st+"]");function ae(e){return ut.test(e)}function lt(e){return e.split("")}var se="\\ud800-\\udfff",ct="\\u0300-\\u036f",dt="\\ufe20-\\ufe2f",ft="\\u20d0-\\u20ff",pt=ct+dt+ft,ht="\\ufe0e\\ufe0f",gt="["+se+"]",z="["+pt+"]",W="\\ud83c[\\udffb-\\udfff]",mt="(?:"+z+"|"+W+")",oe="[^"+se+"]",ue="(?:\\ud83c[\\udde6-\\uddff]){2}",le="[\\ud800-\\udbff][\\udc00-\\udfff]",bt="\\u200d",ce=mt+"?",de="["+ht+"]?",vt="(?:"+bt+"(?:"+[oe,ue,le].join("|")+")"+de+ce+")*",xt=de+ce+vt,Rt="(?:"+[oe+z+"?",z,ue,le,gt].join("|")+")",Pt=RegExp(W+"(?="+W+")|"+Rt+xt,"g");function It(e){return e.match(Pt)||[]}function Dt(e){return ae(e)?It(e):lt(e)}function St(e){return function(t){t=P.toString(t);var i=ae(t)?Dt(t):void 0,d=i?i[0]:t.charAt(0),s=i?et(i,1).join(""):t.slice(1);return d[e]()+s}}var Lt=St("toUpperCase");function kt(e){return Lt(P.toString(e).toLowerCase())}function wt(e,t,i,d){for(var s=-1,n=e==null?0:e.length;++s<n;)i=t(i,e[s],s,e);return i}function Ct(e){return function(t){return e==null?void 0:e[t]}}var At={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Ot=Ct(At),yt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tt="\\u0300-\\u036f",Ut="\\ufe20-\\ufe2f",Et="\\u20d0-\\u20ff",Ft=Tt+Ut+Et,$t="["+Ft+"]",Mt=RegExp($t,"g");function Nt(e){return e=P.toString(e),e&&e.replace(yt,Ot).replace(Mt,"")}var jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function zt(e){return e.match(jt)||[]}var Wt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Vt(e){return Wt.test(e)}var fe="\\ud800-\\udfff",Jt="\\u0300-\\u036f",Ht="\\ufe20-\\ufe2f",_t="\\u20d0-\\u20ff",Bt=Jt+Ht+_t,pe="\\u2700-\\u27bf",he="a-z\\xdf-\\xf6\\xf8-\\xff",Zt="\\xac\\xb1\\xd7\\xf7",qt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Kt="\\u2000-\\u206f",Yt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ge="A-Z\\xc0-\\xd6\\xd8-\\xde",Qt="\\ufe0e\\ufe0f",me=Zt+qt+Kt+Yt,be="['’]",Y="["+me+"]",Xt="["+Bt+"]",ve="\\d+",Gt="["+pe+"]",xe="["+he+"]",Re="[^"+fe+me+ve+pe+he+ge+"]",en="\\ud83c[\\udffb-\\udfff]",tn="(?:"+Xt+"|"+en+")",nn="[^"+fe+"]",Pe="(?:\\ud83c[\\udde6-\\uddff]){2}",Ie="[\\ud800-\\udbff][\\udc00-\\udfff]",w="["+ge+"]",rn="\\u200d",Q="(?:"+xe+"|"+Re+")",an="(?:"+w+"|"+Re+")",X="(?:"+be+"(?:d|ll|m|re|s|t|ve))?",G="(?:"+be+"(?:D|LL|M|RE|S|T|VE))?",De=tn+"?",Se="["+Qt+"]?",sn="(?:"+rn+"(?:"+[nn,Pe,Ie].join("|")+")"+Se+De+")*",on="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",un="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ln=Se+De+sn,cn="(?:"+[Gt,Pe,Ie].join("|")+")"+ln,dn=RegExp([w+"?"+xe+"+"+X+"(?="+[Y,w,"$"].join("|")+")",an+"+"+G+"(?="+[Y,w+Q,"$"].join("|")+")",w+"?"+Q+"+"+X,w+"+"+G,un,on,ve,cn].join("|"),"g");function fn(e){return e.match(dn)||[]}function pn(e,t,i){return e=P.toString(e),t=t,t===void 0?Vt(e)?fn(e):zt(e):e.match(t)||[]}var hn="['’]",gn=RegExp(hn,"g");function mn(e){return function(t){return wt(pn(Nt(t).replace(gn,"")),e,"")}}var bn=mn(function(e,t,i){return t=t.toLowerCase(),e+(i?kt(t):t)}),vn="__lodash_hash_undefined__";function xn(e){return this.__data__.set(e,vn),this}function Rn(e){return this.__data__.has(e)}function O(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new P.MapCache;++t<i;)this.add(e[t])}O.prototype.add=O.prototype.push=xn;O.prototype.has=Rn;function V(e,t){return e.has(t)}function Pn(e){return P.isObjectLike(e)&&Xe(e)}var In=Math.min;function Dn(e,t,i){for(var d=ie,s=e[0].length,n=e.length,r=n,l=Array(n),c=1/0,h=[];r--;){var u=e[r];c=In(u.length,c),l[r]=s>=120&&u.length>=120?new O(r&&u):void 0}u=e[0];var p=-1,g=l[0];e:for(;++p<s&&h.length<c;){var o=u[p],f=o;if(o=o!==0?o:0,!(g?V(g,f):d(h,f))){for(r=n;--r;){var m=l[r];if(!(m?V(m,f):d(e[r],f)))continue e}g&&g.push(f),h.push(o)}}return h}function Sn(e){return Pn(e)?e:[]}var Ln=Ke(function(e){var t=P.arrayMap(e,Sn);return t.length&&t[0]===e[0]?Dn(t):[]});const kn={complex:["tar.bz2","tar.gz","tar.xz"]},wn=e=>Object.hasOwn(e,"ddate"),Cn=e=>Object.hasOwn(e,"highlights"),F=e=>e.replace(/[^A-Za-z0-9\-_]/g,""),Le=(e,t)=>!e||typeof e!="string"?"":e.indexOf("!")>=0?e.split("!")[t]:"",ke=e=>Le(e,0),H=e=>Le(e,1),An=e=>{const t=e.extension||"",i=e.name||"";if(!t.length)return i;const d=i.lastIndexOf(`.${t}`);return i.substring(0,d)},$=e=>{const t=e.name;if(e.type==="directory"||e.isFolder)return"";const i=t.split(".");if(i.length>2)for(let d=0;d<i.length;d++){const s=i.slice(d,i.length).join(".");if(kn.complex.includes(s))return s}return i.length<2?"":i[i.length-1]},On=e=>U.basename(U.dirname(e.path))||null,yn=e=>typeof e.isShareRoot=="function"&&e.isShareRoot(),y=e=>{if(!e)return e;const t={};return Object.keys(e).forEach(i=>{t[bn(i)]=e[i]}),t};function Tn(e,t=[]){var f,m,D;const i=((f=e.props[a.Name])==null?void 0:f.toString())||U.basename(e.filename),d=e.props[a.FileId],s=e.type==="directory";let n;e.filename.startsWith("/files")||e.filename.startsWith("/space")?n=e.filename.split("/").slice(3).join("/"):n=e.filename,n.startsWith("/")||(n=`/${n}`);const r=$({...e,name:i}),l=e.props[a.LockDiscovery];let c,h,u;l&&(c=l[a.ActiveLock],h=c[a.LockOwner],u=c[a.LockTime]);let p=[];e.props[a.ShareTypes]&&(p=e.props[a.ShareTypes]["share-type"],Array.isArray(p)||(p=[p]));const g={};for(const k of t||[]){const S=k.split(":").pop();e.props[S]&&(g[k]=e.props[S])}const o={id:d,fileId:d,storageId:ke(d),parentFolderId:e.props[a.FileParent],mimeType:e.props[a.MimeType],name:i,extension:s?"":r,path:n,webDavPath:e.filename,type:s?"folder":e.type,isFolder:s,locked:!!c,lockOwner:h,lockTime:u,processing:e.processing||!1,mdate:e.props[a.LastModifiedDate],size:s?((m=e.props[a.ContentSize])==null?void 0:m.toString())||"0":((D=e.props[a.ContentLength])==null?void 0:D.toString())||"0",permissions:e.props[a.Permissions]||"",starred:e.props[a.IsFavorite]!==0,etag:e.props[a.ETag],shareTypes:p,privateLink:e.props[a.PrivateLink],downloadURL:e.props[a.DownloadURL],remoteItemId:e.props[a.RemoteItemId],remoteItemPath:e.props[a.ShareRoot],owner:{id:e.props[a.OwnerId],displayName:e.props[a.OwnerDisplayName]},tags:(e.props[a.Tags]||"").toString().split(",").filter(Boolean),audio:y(e.props[a.Audio]),location:y(e.props[a.Location]),image:y(e.props[a.Image]),photo:y(e.props[a.Photo]),extraProps:g,canUpload:function(){return this.permissions.indexOf(R.FolderCreateable)>=0},canDownload:function(){return this.permissions.indexOf(R.SecureView)===-1},canBeDeleted:function(){return this.permissions.indexOf(R.Deletable)>=0},canRename:function(){return this.permissions.indexOf(R.Renameable)>=0},canShare:function({ability:k}){return k.can("create-all","Share")&&this.permissions.indexOf(R.Shareable)>=0},canCreate:function(){return this.permissions.indexOf(R.FolderCreateable)>=0},canEditTags:function(){return this.permissions.indexOf(R.Updateable)>=0||this.permissions.indexOf(R.FileUpdateable)>=0},isMounted:function(){return this.permissions.indexOf(R.Mounted)>=0},isReceivedShare:function(){return this.permissions.indexOf(R.Shared)>=0},isShareRoot(){return e.props[a.ShareRoot]?e.filename.split("/").length===3:!1},canDeny:function(){return this.permissions.indexOf(R.Deny)>=0},getDomSelector:()=>F(d)};return Object.defineProperty(o,"nodeId",{get(){return H(this.id)}}),o}function Un(e){var n;const t=e.type==="directory",i=(n=e.props[a.TrashbinOriginalFilename])==null?void 0:n.toString(),d=$({name:i,type:e.type}),s=Z.basename(e.filename);return{type:t?"folder":e.type,isFolder:t,ddate:e.props[a.TrashbinDeletedDate],name:Z.basename(i),extension:d,path:P.urlJoin(e.props[a.TrashbinOriginalLocation],{leadingSlash:!0}),id:s,parentFolderId:e.props[a.FileParent],webDavPath:"",canUpload:()=>!1,canDownload:()=>!1,canBeDeleted:()=>!0,canBeRestored:function(){return!0},canRename:()=>!1,canShare:()=>!1,canCreate:()=>!1,isMounted:()=>!1,isReceivedShare:()=>!1,getDomSelector:()=>F(s)}}var I=(e=>(e.createUpload="libre.graph/driveItem/upload/create",e.createPermissions="libre.graph/driveItem/permissions/create",e.createChildren="libre.graph/driveItem/children/create",e.readBasic="libre.graph/driveItem/basic/read",e.readPath="libre.graph/driveItem/path/read",e.readQuota="libre.graph/driveItem/quota/read",e.readContent="libre.graph/driveItem/content/read",e.readChildren="libre.graph/driveItem/children/read",e.readDeleted="libre.graph/driveItem/deleted/read",e.readPermissions="libre.graph/driveItem/permissions/read",e.readVersions="libre.graph/driveItem/versions/read",e.updatePath="libre.graph/driveItem/path/update",e.updateDeleted="libre.graph/driveItem/deleted/update",e.updatePermissions="libre.graph/driveItem/permissions/update",e.updateVersions="libre.graph/driveItem/versions/update",e.deleteStandard="libre.graph/driveItem/standard/delete",e.deleteDeleted="libre.graph/driveItem/deleted/delete",e.deletePermissions="libre.graph/driveItem/permissions/delete",e))(I||{});const A=e=>e;class C{constructor(t,i,d,s){b(this,"_key");b(this,"_value");b(this,"_label");b(this,"_icon");this._key=t,this._value=i,this._label=d,this._icon=s}get key(){return this._key}get value(){return this._value}get label(){return this._label}get icon(){return this._icon}}const x=class x{static isIndividual(t){return this.individuals.includes(t)}static isCollective(t){return this.collectives.includes(t)}static isUnauthenticated(t){return this.unauthenticated.includes(t)}static isAuthenticated(t){return this.authenticated.includes(t)}static getByValue(t){return this.all.find(i=>i.value===t)}static getByValues(t){return t.map(i=>this.getByValue(i))}static getByKeys(t){return t.map(i=>this.all.find(d=>d.key===i))}static getValues(t){return t.map(i=>i.value)}static containsAnyValue(t,i){return Ln(this.getValues(t),i).length>0}};b(x,"user",new C("user",0,A("User"),"user")),b(x,"group",new C("group",1,A("Group"),"group")),b(x,"link",new C("link",3,A("Link"),"link")),b(x,"guest",new C("guest",4,A("Guest"),"global")),b(x,"remote",new C("remote",6,A("External"),"earth")),b(x,"individuals",[x.user,x.guest,x.remote]),b(x,"collectives",[x.group]),b(x,"unauthenticated",[x.link]),b(x,"authenticated",[x.user,x.group,x.guest,x.remote]),b(x,"all",[x.user,x.group,x.link,x.guest,x.remote]);let J=x;const En="a0ca6a90-a365-4782-871e-d44447bbc668",Fn="89f37a33-858b-45fa-8890-a1f2b27d90e1",$n=e=>(e==null?void 0:e.type)==="space",T=e=>(e==null?void 0:e.driveType)==="personal",Mn=e=>(e==null?void 0:e.driveType)==="project",Nn=e=>(e==null?void 0:e.driveType)==="share",jn=e=>(e==null?void 0:e.driveType)==="mountpoint",zn=e=>(e==null?void 0:e.driveType)==="public";function we(e,t){return P.urlJoin("spaces",e,t,{leadingSlash:!0})}function Ce(e,t=""){return P.urlJoin("spaces","trash-bin",e,t,{leadingSlash:!0})}function Wn(e,t){const d=e[{image:"spaceImageData",readme:"spaceReadmeData"}[t]];if(!d)return"";const s=decodeURI(d.webDavUrl).split("/"),n=s.find(r=>r.startsWith(e.id));return n?s.slice(s.indexOf(n)+1).join("/"):""}function Vn(e){return e.permissions.includes(I.deletePermissions)}function Jn(e){var p,g,o,f,m,D;const t=e.publicLinkPassword,i=(p=e.props)==null?void 0:p[a.FileId],d=(g=e.props)==null?void 0:g[a.PublicLinkItemType],s=(o=e.props)==null?void 0:o[a.PublicLinkPermission],n=(f=e.props)==null?void 0:f[a.PublicLinkExpiration],r=(m=e.props)==null?void 0:m[a.PublicLinkShareDate],l=(D=e.props)==null?void 0:D[a.PublicLinkShareOwner],c=e.publicLinkType;let h,u;return c==="ocm"?(h=`ocm/${e.id}`,u=te(e.id)):(h=`public/${e.id}`,u=ee(e.id)),Object.assign(_({...e,driveType:"public",driveAlias:h,webDavPath:u}),{...i&&{fileId:i},...t&&{publicLinkPassword:t},...d&&{publicLinkItemType:d},...s&&{publicLinkPermission:parseInt(s)},...n&&{publicLinkExpiration:n},...r&&{publicLinkShareDate:r},...l&&{publicLinkShareOwner:l},publicLinkType:c})}function Hn({driveAliasPrefix:e,id:t,shareName:i,serverUrl:d}){const s=_({id:t,driveAlias:`${e}/${i}`,driveType:"share",name:i,serverUrl:d});return s.rename=n=>{s.driveAlias=`${e}/${n}`,s.name=n},s}function _(e){var h,u,p,g;let t,i;e.special&&(t=e.special.find(o=>o.specialFolder.name==="image"),i=e.special.find(o=>o.specialFolder.name==="readme"),t&&(t.webDavUrl=decodeURI(t.webDavUrl)),i&&(i.webDavUrl=decodeURI(i.webDavUrl)));const d=((u=(h=e.root)==null?void 0:h.deleted)==null?void 0:u.state)==="trashed",s=P.urlJoin(e.webDavPath||we(e.id),{leadingSlash:!0}),n=P.urlJoin(e.serverUrl,"remote.php/dav",s),r=P.urlJoin(e.webDavTrashPath||Ce(e.id),{leadingSlash:!0}),l=P.urlJoin(e.serverUrl,"remote.php/dav",r),c={id:e.id,fileId:e.id,storageId:e.id,mimeType:"",name:e.name,description:e.description,extension:"",path:"/",webDavPath:s,webDavTrashPath:r,driveAlias:e.driveAlias,driveType:e.driveType,type:"space",isFolder:!0,mdate:e.lastModifiedDateTime,size:((p=e.quota)==null?void 0:p.used)||0,tags:[],permissions:"",starred:!1,etag:"",shareTypes:[],privateLink:e.webUrl,downloadURL:"",owner:(g=e.owner)==null?void 0:g.user,disabled:d,root:e.root,spaceQuota:e.quota,spaceImageData:t,spaceReadmeData:i,hasTrashedItems:e["@libre.graph.hasTrashedItems"]||!1,graphPermissions:void 0,canUpload:function({user:o}={}){var f;return T(this)&&this.isOwner(o)?!0:(f=this.graphPermissions)==null?void 0:f.includes(I.createUpload)},canDownload:function(){return!0},canBeDeleted:function({ability:o}={}){var f;return this.disabled?o!=null&&o.can("delete-all","Drive")?!0:(f=this.graphPermissions)==null?void 0:f.includes(I.deletePermissions):!1},canRename:function({ability:o}={}){var f;return o!=null&&o.can("update-all","Drive")?!0:(f=this.graphPermissions)==null?void 0:f.includes(I.deletePermissions)},canEditDescription:function({ability:o}={}){var f;return o!=null&&o.can("update-all","Drive")?!0:(f=this.graphPermissions)==null?void 0:f.includes(I.deletePermissions)},canRestore:function({ability:o}={}){var f;return this.disabled?o!=null&&o.can("update-all","Drive")?!0:(f=this.graphPermissions)==null?void 0:f.includes(I.deletePermissions):!1},canDisable:function({ability:o}={}){var f;return this.disabled?!1:o!=null&&o.can("delete-all","Drive")?!0:(f=this.graphPermissions)==null?void 0:f.includes(I.deletePermissions)},canShare:function(){var o;return(o=this.graphPermissions)==null?void 0:o.includes(I.createPermissions)},canEditImage:function(){var o;return this.disabled?!1:(o=this.graphPermissions)==null?void 0:o.includes(I.deletePermissions)},canEditReadme:function(){var o;return this.disabled?!1:(o=this.graphPermissions)==null?void 0:o.includes(I.deletePermissions)},canRestoreFromTrashbin:function(){var o;return(o=this.graphPermissions)==null?void 0:o.includes(I.updateDeleted)},canDeleteFromTrashBin:function({user:o}={}){var f;return T(this)&&this.isOwner(o)?!0:(f=this.graphPermissions)==null?void 0:f.includes(I.deletePermissions)},canListVersions:function({user:o}={}){var f;return T(this)&&this.isOwner(o)?!0:(f=this.graphPermissions)==null?void 0:f.includes(I.readVersions)},canCreate:function(){return!0},canEditTags:function(){return!1},isMounted:function(){return!0},isReceivedShare:function(){return!1},isShareRoot:function(){return["share","mountpoint","public"].includes(e.driveType)},canDeny:()=>!1,getDomSelector:()=>F(e.id),getDriveAliasAndItem({path:o}){return P.urlJoin(this.driveAlias,o,{leadingSlash:!1})},getWebDavUrl({path:o}){return P.urlJoin(n,o)},getWebDavTrashUrl({path:o}){return P.urlJoin(l,o)},isOwner(o){var f;return(o==null?void 0:o.id)===((f=this.owner)==null?void 0:f.id)}};return Object.defineProperty(c,"nodeId",{get(){return H(this.id)}}),c}function _n(e){return{id:e.spaceImageData.id,name:e.spaceImageData.name,etag:e.spaceImageData.eTag,extension:$({name:e.spaceImageData.name}),mimeType:e.spaceImageData.file.mimeType,type:"file",webDavPath:P.urlJoin(e.webDavPath,".space",e.spaceImageData.name),canDownload:()=>!0}}exports.DavMethod=ne;exports.DavPermission=R;exports.DavProperties=j;exports.DavProperty=a;exports.GraphSharePermission=I;exports.OCM_PROVIDER_ID=Fn;exports.SHARE_JAIL_ID=En;exports.SetCache=O;exports.ShareType=C;exports.ShareTypes=J;exports.arrayIncludes=ie;exports.buildDeletedResource=Un;exports.buildPublicSpaceResource=Jn;exports.buildResource=Tn;exports.buildShareSpaceResource=Hn;exports.buildSpace=_;exports.buildSpaceImageResource=_n;exports.buildWebDavOcmPath=te;exports.buildWebDavPublicPath=ee;exports.buildWebDavSpacesPath=we;exports.buildWebDavSpacesTrashPath=Ce;exports.cacheHas=V;exports.extractDomSelector=F;exports.extractExtensionFromFile=$;exports.extractNameWithoutExtension=An;exports.extractNodeId=H;exports.extractParentFolderName=On;exports.extractStorageId=ke;exports.getRelativeSpecialFolderSpacePath=Wn;exports.isManager=Vn;exports.isMountPointSpaceResource=jn;exports.isPersonalSpaceResource=T;exports.isProjectSpaceResource=Mn;exports.isPublicSpaceResource=zn;exports.isSearchResource=Cn;exports.isShareRoot=yn;exports.isShareSpaceResource=Nn;exports.isSpaceResource=$n;exports.isTrashResource=wn;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Br=Object.defineProperty;var Rt=r=>{throw TypeError(r)};var qr=(r,e,t)=>e in r?Br(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var U=(r,e,t)=>qr(r,typeof e!="symbol"?e+"":e,t),Je=(r,e,t)=>e.has(r)||Rt("Cannot "+t);var S=(r,e,t)=>(Je(r,e,"read from private field"),t?t.call(r):e.get(r)),oe=(r,e,t)=>e.has(r)?Rt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),X=(r,e,t,n)=>(Je(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),me=(r,e,t)=>(Je(r,e,"access private method"),t);const Wr=require("./index-C-U4KVPG.cjs"),L=require("./functions-BCZphZWf.cjs"),W=require("./toString-hHr716Th.cjs"),Xr=require("./web-client/ocs.cjs"),ce=require("./index-C6VnMvgz.cjs"),Ie=r=>encodeURIComponent(r).split("%2F").join("/");class xt extends Error{constructor(t,n,o=null){super(t);U(this,"response");U(this,"statusCode");this.response=n,this.statusCode=o}}class mr extends xt{constructor(t,n,o,u=null){super(t,o,u);U(this,"errorCode");this.errorCode=n}}const ge=(r,{fileId:e,path:t,name:n})=>{if(t!==void 0)return W.urlJoin(r.webDavPath,t);if(e!==void 0){if(L.isPublicSpaceResource(r))throw new Error("public spaces need a path provided");return W.urlJoin("spaces",e,n||"")}return r.webDavPath},Gr=(r,e)=>({copyFiles(t,{path:n,fileId:o},u,{path:l,parentFolderId:i,name:h},{overwrite:a,...s}={}){const f=ge(t,{fileId:o,path:n}),c=ge(u,{fileId:i,path:l,name:h});return r.copy(f,c,{overwrite:a||!1,...s})}}),zr=(r,e,t)=>({async createFolder(n,{path:o,parentFolderId:u,folderName:l,fetchFolder:i=!0,...h}){const a=ge(n,{fileId:u,path:o,name:l});if(await r.mkcol(a),i)return e.getFileInfo(n,{path:o},h)}}),Jr=(r,{axiosClient:e})=>({async getFileContents(t,{fileId:n,path:o},{responseType:u="text",noCache:l=!0,headers:i,...h}={}){try{const a=ge(t,{fileId:n,path:o}),s=await e.get(r.getFileUrl(a),{responseType:u,headers:{...l&&{"Cache-Control":"no-cache"},...i||{}},...h});return{response:s,body:s.data,headers:{ETag:s.headers.etag,"OC-ETag":s.headers["oc-etag"],"OC-FileId":s.headers["oc-fileid"]}}}catch(a){const{message:s,response:f}=a;throw new xt(s,f,f.status)}}}),Hr=(r,e)=>({async getFileInfo(t,n,o){return(await r.listFiles(t,n,{depth:0,...o})).resource}}),Zr=(r,e,{axiosClient:t,baseUrl:n})=>({async getFileUrl(o,u,{disposition:l="attachment",isUrlSigningEnabled:i=!1,signUrlTimeout:h=86400,version:a=null,doHeadRequest:s=!1,username:f="",...c}){const d=l==="inline";let{downloadURL:m}=u,g=!0;if(!m&&!d&&(m=a?r.getFileUrl(W.urlJoin("meta",u.fileId,"v",a)):r.getFileUrl(u.webDavPath),f&&s&&await t.head(m),i&&f?m=await Xr.ocs(n,t).signUrl(m,f):g=!1),!g||d){const w=await e.getFileContents(o,u,{responseType:"blob",...c});m=URL.createObjectURL(w.body)}return m},revokeUrl:o=>{o&&o.startsWith("blob:")&&URL.revokeObjectURL(o)}}),Yr=(r,e)=>({getPublicFileUrl(t,n){return r.getFileUrl(W.urlJoin("public-files",n))}}),Kr=(r,e,t)=>({async listFiles(n,{path:o,fileId:u}={},{depth:l=1,davProperties:i,isTrash:h=!1,...a}={}){let s;if(L.isPublicSpaceResource(n)){s=await r.propfind(W.urlJoin(n.webDavPath,o),{depth:l,properties:i||L.DavProperties.PublicLink,...a}),s.forEach(m=>{m.filename=m.filename.split("/").slice(1).join("/")}),s.length===1&&(s[0].filename=W.urlJoin(n.id,o,{leadingSlash:!0})),s.forEach(m=>{m.filename=m.filename.split("/").slice(2).join("/")});const c=n.driveAlias.startsWith("ocm/")?"ocm":"public-link";if((!o||o==="/")&&l>0&&c==="ocm"&&s[0].props[L.DavProperty.PublicLinkItemType]==="file"&&(s=[{basename:n.fileId,type:"directory",filename:"",props:{}},...s]),!o){const[m,...g]=s;return{resource:L.buildPublicSpaceResource({...m,id:n.id,driveAlias:n.driveAlias,webDavPath:n.webDavPath,publicLinkType:c}),children:g.map(w=>L.buildResource(w,r.extraProps))}}const d=s.map(m=>L.buildResource(m,r.extraProps));return{resource:d[0],children:d.slice(1)}}const f=async()=>{const c=await e.getPathForFileId(u);return this.listFiles(n,{path:c},{depth:l,davProperties:i})};try{let c="";if(h?c=L.buildWebDavSpacesTrashPath(n.id):c=ge(n,{fileId:u,path:o}),s=await r.propfind(c,{depth:l,properties:i||L.DavProperties.Default,...a}),h)return{resource:L.buildResource(s[0],r.extraProps),children:s.slice(1).map(L.buildDeletedResource)};const d=s.map(g=>L.buildResource(g,r.extraProps)),m=u===n.id;return u&&!m&&u!==d[0].fileId?f():{resource:d[0],children:d.slice(1)}}catch(c){if(c.statusCode===404&&u)return f();throw c}}}),Qr=(r,e)=>({moveFiles(t,{path:n,fileId:o},u,{path:l,parentFolderId:i,name:h},{overwrite:a,...s}={}){const f=ge(t,{fileId:o,path:n}),c=ge(u,{fileId:i,path:l,name:h});return r.move(f,c,{overwrite:a||!1,...s})}}),Dr=(r,e,t)=>({async putFileContents(n,{fileName:o,path:u,parentFolderId:l,content:i="",previousEntityTag:h="",overwrite:a,onUploadProgress:s=null,...f}){const c=ge(n,{fileId:l,name:o,path:u}),{result:d}=await r.put(c,i,{previousEntityTag:h,overwrite:a,onUploadProgress:s,...f});return e.getFileInfo(n,{fileId:d.headers.get("Oc-Fileid"),path:u})}}),en=(r,e)=>({deleteFile(t,{path:n,...o}){return r.delete(W.urlJoin(t.webDavPath,n),o)}}),tn=(r,e)=>({restoreFile(t,{id:n},{path:o},{overwrite:u,...l}={}){if(L.isPublicSpaceResource(t))return;const i=W.urlJoin(t.webDavPath,o);return r.move(W.urlJoin(t.webDavTrashPath,n),i,{overwrite:u,...l})}}),rn=(r,e)=>({restoreFileVersion(t,{parentFolderId:n,name:o,path:u},l,i={}){const h=ge(t,{path:u,fileId:n,name:o}),a=W.urlJoin("meta",n,"v",l,{leadingSlash:!0}),s=W.urlJoin("files",h,{leadingSlash:!0});return r.copy(a,s,i)}}),nn=(r,e)=>({clearTrashBin(t,{id:n,...o}={}){let u=L.buildWebDavSpacesTrashPath(t.id);return n&&(u=W.urlJoin(u,n)),r.delete(u,o)}}),sn=(r,e)=>({async search(t,{davProperties:n=L.DavProperties.Default,searchLimit:o,...u}){const l="/spaces/",{range:i,results:h}=await r.report(l,{pattern:t,limit:o,properties:n,...u});return{resources:h.map(a=>({...L.buildResource(a,r.extraProps),highlights:a.props[L.DavProperty.Highlights]||""})),totalResults:i?parseInt(i==null?void 0:i.split("/")[1]):null}}}),on=(r,e)=>({async getPathForFileId(t,n={}){return(await r.propfind(W.urlJoin("meta",t,{leadingSlash:!0}),{properties:[L.DavProperty.MetaPathForUser],...n}))[0].props[L.DavProperty.MetaPathForUser]}});/*! For license information please see index.js.LICENSE.txt */var an={2:r=>{function e(o,u,l){o instanceof RegExp&&(o=t(o,l)),u instanceof RegExp&&(u=t(u,l));var i=n(o,u,l);return i&&{start:i[0],end:i[1],pre:l.slice(0,i[0]),body:l.slice(i[0]+o.length,i[1]),post:l.slice(i[1]+u.length)}}function t(o,u){var l=u.match(o);return l?l[0]:null}function n(o,u,l){var i,h,a,s,f,c=l.indexOf(o),d=l.indexOf(u,c+1),m=c;if(c>=0&&d>0){for(i=[],a=l.length;m>=0&&!f;)m==c?(i.push(m),c=l.indexOf(o,m+1)):i.length==1?f=[i.pop(),d]:((h=i.pop())<a&&(a=h,s=d),d=l.indexOf(u,m+1)),m=c<d&&c>=0?c:d;i.length&&(f=[a,s])}return f}r.exports=e,e.range=n},101:function(r,e,t){var n;r=t.nmd(r),function(o){var u=(r&&r.exports,typeof ce.global=="object"&&ce.global);u.global!==u&&u.window;var l=function(f){this.message=f};(l.prototype=new Error).name="InvalidCharacterError";var i=function(f){throw new l(f)},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=/[\t\n\f\r ]/g,s={encode:function(f){f=String(f),/[^\0-\xFF]/.test(f)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var c,d,m,g,w=f.length%3,y="",p=-1,v=f.length-w;++p<v;)c=f.charCodeAt(p)<<16,d=f.charCodeAt(++p)<<8,m=f.charCodeAt(++p),y+=h.charAt((g=c+d+m)>>18&63)+h.charAt(g>>12&63)+h.charAt(g>>6&63)+h.charAt(63&g);return w==2?(c=f.charCodeAt(p)<<8,d=f.charCodeAt(++p),y+=h.charAt((g=c+d)>>10)+h.charAt(g>>4&63)+h.charAt(g<<2&63)+"="):w==1&&(g=f.charCodeAt(p),y+=h.charAt(g>>2)+h.charAt(g<<4&63)+"=="),y},decode:function(f){var c=(f=String(f).replace(a,"")).length;c%4==0&&(c=(f=f.replace(/==?$/,"")).length),(c%4==1||/[^+a-zA-Z0-9/]/.test(f))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var d,m,g=0,w="",y=-1;++y<c;)m=h.indexOf(f.charAt(y)),d=g%4?64*d+m:m,g++%4&&(w+=String.fromCharCode(255&d>>(-2*g&6)));return w},version:"1.0.0"};(n=(function(){return s}).call(e,t,e,r))===void 0||(r.exports=n)}()},172:(r,e)=>{e.d=function(t){if(!t)return 0;for(var n=(t=t.toString()).length,o=t.length;o--;){var u=t.charCodeAt(o);56320<=u&&u<=57343&&o--,127<u&&u<=2047?n++:2047<u&&u<=65535&&(n+=2)}return n}},526:r=>{var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var n=[],o=0;o<t.length;o++)n.push(255&t.charCodeAt(o));return n},bytesToString:function(t){for(var n=[],o=0;o<t.length;o++)n.push(String.fromCharCode(t[o]));return n.join("")}}};r.exports=e},298:r=>{var e,t;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(n,o){return n<<o|n>>>32-o},rotr:function(n,o){return n<<32-o|n>>>o},endian:function(n){if(n.constructor==Number)return 16711935&t.rotl(n,8)|4278255360&t.rotl(n,24);for(var o=0;o<n.length;o++)n[o]=t.endian(n[o]);return n},randomBytes:function(n){for(var o=[];n>0;n--)o.push(Math.floor(256*Math.random()));return o},bytesToWords:function(n){for(var o=[],u=0,l=0;u<n.length;u++,l+=8)o[l>>>5]|=n[u]<<24-l%32;return o},wordsToBytes:function(n){for(var o=[],u=0;u<32*n.length;u+=8)o.push(n[u>>>5]>>>24-u%32&255);return o},bytesToHex:function(n){for(var o=[],u=0;u<n.length;u++)o.push((n[u]>>>4).toString(16)),o.push((15&n[u]).toString(16));return o.join("")},hexToBytes:function(n){for(var o=[],u=0;u<n.length;u+=2)o.push(parseInt(n.substr(u,2),16));return o},bytesToBase64:function(n){for(var o=[],u=0;u<n.length;u+=3)for(var l=n[u]<<16|n[u+1]<<8|n[u+2],i=0;i<4;i++)8*u+6*i<=8*n.length?o.push(e.charAt(l>>>6*(3-i)&63)):o.push("=");return o.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],u=0,l=0;u<n.length;l=++u%4)l!=0&&o.push((e.indexOf(n.charAt(u-1))&Math.pow(2,-2*l+8)-1)<<2*l|e.indexOf(n.charAt(u))>>>6-2*l);return o}},r.exports=t},635:(r,e,t)=>{const n=t(31),o=t(338),u=t(221);r.exports={XMLParser:o,XMLValidator:n,XMLBuilder:u}},118:r=>{r.exports=function(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const n of e)if(typeof n=="string"&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}},705:(r,e)=>{const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+t+"]["+t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+n+"$");e.isExist=function(u){return u!==void 0},e.isEmptyObject=function(u){return Object.keys(u).length===0},e.merge=function(u,l,i){if(l){const h=Object.keys(l),a=h.length;for(let s=0;s<a;s++)u[h[s]]=i==="strict"?[l[h[s]]]:l[h[s]]}},e.getValue=function(u){return e.isExist(u)?u:""},e.isName=function(u){return o.exec(u)!=null},e.getAllMatches=function(u,l){const i=[];let h=l.exec(u);for(;h;){const a=[];a.startIndex=l.lastIndex-h[0].length;const s=h.length;for(let f=0;f<s;f++)a.push(h[f]);i.push(a),h=l.exec(u)}return i},e.nameRegexp=n},31:(r,e,t)=>{const n=t(705),o={allowBooleanAttributes:!1,unpairedTags:[]};function u(p){return p===" "||p===" "||p===`
|
|
1
|
+
"use strict";var Br=Object.defineProperty;var Rt=r=>{throw TypeError(r)};var qr=(r,e,t)=>e in r?Br(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var U=(r,e,t)=>qr(r,typeof e!="symbol"?e+"":e,t),Je=(r,e,t)=>e.has(r)||Rt("Cannot "+t);var S=(r,e,t)=>(Je(r,e,"read from private field"),t?t.call(r):e.get(r)),oe=(r,e,t)=>e.has(r)?Rt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),X=(r,e,t,n)=>(Je(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),me=(r,e,t)=>(Je(r,e,"access private method"),t);const Wr=require("./index-C-U4KVPG.cjs"),L=require("./functions-DEaUzlbB.cjs"),W=require("./toString-hHr716Th.cjs"),Xr=require("./web-client/ocs.cjs"),ce=require("./index-C6VnMvgz.cjs"),Ie=r=>encodeURIComponent(r).split("%2F").join("/");class xt extends Error{constructor(t,n,o=null){super(t);U(this,"response");U(this,"statusCode");this.response=n,this.statusCode=o}}class mr extends xt{constructor(t,n,o,u=null){super(t,o,u);U(this,"errorCode");this.errorCode=n}}const ge=(r,{fileId:e,path:t,name:n})=>{if(t!==void 0)return W.urlJoin(r.webDavPath,t);if(e!==void 0){if(L.isPublicSpaceResource(r))throw new Error("public spaces need a path provided");return W.urlJoin("spaces",e,n||"")}return r.webDavPath},Gr=(r,e)=>({copyFiles(t,{path:n,fileId:o},u,{path:l,parentFolderId:i,name:h},{overwrite:a,...s}={}){const f=ge(t,{fileId:o,path:n}),c=ge(u,{fileId:i,path:l,name:h});return r.copy(f,c,{overwrite:a||!1,...s})}}),zr=(r,e,t)=>({async createFolder(n,{path:o,parentFolderId:u,folderName:l,fetchFolder:i=!0,...h}){const a=ge(n,{fileId:u,path:o,name:l});if(await r.mkcol(a),i)return e.getFileInfo(n,{path:o},h)}}),Jr=(r,{axiosClient:e})=>({async getFileContents(t,{fileId:n,path:o},{responseType:u="text",noCache:l=!0,headers:i,...h}={}){try{const a=ge(t,{fileId:n,path:o}),s=await e.get(r.getFileUrl(a),{responseType:u,headers:{...l&&{"Cache-Control":"no-cache"},...i||{}},...h});return{response:s,body:s.data,headers:{ETag:s.headers.etag,"OC-ETag":s.headers["oc-etag"],"OC-FileId":s.headers["oc-fileid"]}}}catch(a){const{message:s,response:f}=a;throw new xt(s,f,f.status)}}}),Hr=(r,e)=>({async getFileInfo(t,n,o){return(await r.listFiles(t,n,{depth:0,...o})).resource}}),Zr=(r,e,{axiosClient:t,baseUrl:n})=>({async getFileUrl(o,u,{disposition:l="attachment",isUrlSigningEnabled:i=!1,signUrlTimeout:h=86400,version:a=null,doHeadRequest:s=!1,username:f="",...c}){const d=l==="inline";let{downloadURL:m}=u,g=!0;if(!m&&!d&&(m=a?r.getFileUrl(W.urlJoin("meta",u.fileId,"v",a)):r.getFileUrl(u.webDavPath),f&&s&&await t.head(m),i&&f?m=await Xr.ocs(n,t).signUrl(m,f):g=!1),!g||d){const w=await e.getFileContents(o,u,{responseType:"blob",...c});m=URL.createObjectURL(w.body)}return m},revokeUrl:o=>{o&&o.startsWith("blob:")&&URL.revokeObjectURL(o)}}),Yr=(r,e)=>({getPublicFileUrl(t,n){return r.getFileUrl(W.urlJoin("public-files",n))}}),Kr=(r,e,t)=>({async listFiles(n,{path:o,fileId:u}={},{depth:l=1,davProperties:i,isTrash:h=!1,...a}={}){let s;if(L.isPublicSpaceResource(n)){s=await r.propfind(W.urlJoin(n.webDavPath,o),{depth:l,properties:i||L.DavProperties.PublicLink,...a}),s.forEach(m=>{m.filename=m.filename.split("/").slice(1).join("/")}),s.length===1&&(s[0].filename=W.urlJoin(n.id,o,{leadingSlash:!0})),s.forEach(m=>{m.filename=m.filename.split("/").slice(2).join("/")});const c=n.driveAlias.startsWith("ocm/")?"ocm":"public-link";if((!o||o==="/")&&l>0&&c==="ocm"&&s[0].props[L.DavProperty.PublicLinkItemType]==="file"&&(s=[{basename:n.fileId,type:"directory",filename:"",props:{}},...s]),!o){const[m,...g]=s;return{resource:L.buildPublicSpaceResource({...m,id:n.id,driveAlias:n.driveAlias,webDavPath:n.webDavPath,publicLinkType:c}),children:g.map(w=>L.buildResource(w,r.extraProps))}}const d=s.map(m=>L.buildResource(m,r.extraProps));return{resource:d[0],children:d.slice(1)}}const f=async()=>{const c=await e.getPathForFileId(u);return this.listFiles(n,{path:c},{depth:l,davProperties:i})};try{let c="";if(h?c=L.buildWebDavSpacesTrashPath(n.id):c=ge(n,{fileId:u,path:o}),s=await r.propfind(c,{depth:l,properties:i||L.DavProperties.Default,...a}),h)return{resource:L.buildResource(s[0],r.extraProps),children:s.slice(1).map(L.buildDeletedResource)};const d=s.map(g=>L.buildResource(g,r.extraProps)),m=u===n.id;return u&&!m&&u!==d[0].fileId?f():{resource:d[0],children:d.slice(1)}}catch(c){if(c.statusCode===404&&u)return f();throw c}}}),Qr=(r,e)=>({moveFiles(t,{path:n,fileId:o},u,{path:l,parentFolderId:i,name:h},{overwrite:a,...s}={}){const f=ge(t,{fileId:o,path:n}),c=ge(u,{fileId:i,path:l,name:h});return r.move(f,c,{overwrite:a||!1,...s})}}),Dr=(r,e,t)=>({async putFileContents(n,{fileName:o,path:u,parentFolderId:l,content:i="",previousEntityTag:h="",overwrite:a,onUploadProgress:s=null,...f}){const c=ge(n,{fileId:l,name:o,path:u}),{result:d}=await r.put(c,i,{previousEntityTag:h,overwrite:a,onUploadProgress:s,...f});return e.getFileInfo(n,{fileId:d.headers.get("Oc-Fileid"),path:u})}}),en=(r,e)=>({deleteFile(t,{path:n,...o}){return r.delete(W.urlJoin(t.webDavPath,n),o)}}),tn=(r,e)=>({restoreFile(t,{id:n},{path:o},{overwrite:u,...l}={}){if(L.isPublicSpaceResource(t))return;const i=W.urlJoin(t.webDavPath,o);return r.move(W.urlJoin(t.webDavTrashPath,n),i,{overwrite:u,...l})}}),rn=(r,e)=>({restoreFileVersion(t,{parentFolderId:n,name:o,path:u},l,i={}){const h=ge(t,{path:u,fileId:n,name:o}),a=W.urlJoin("meta",n,"v",l,{leadingSlash:!0}),s=W.urlJoin("files",h,{leadingSlash:!0});return r.copy(a,s,i)}}),nn=(r,e)=>({clearTrashBin(t,{id:n,...o}={}){let u=L.buildWebDavSpacesTrashPath(t.id);return n&&(u=W.urlJoin(u,n)),r.delete(u,o)}}),sn=(r,e)=>({async search(t,{davProperties:n=L.DavProperties.Default,searchLimit:o,...u}){const l="/spaces/",{range:i,results:h}=await r.report(l,{pattern:t,limit:o,properties:n,...u});return{resources:h.map(a=>({...L.buildResource(a,r.extraProps),highlights:a.props[L.DavProperty.Highlights]||""})),totalResults:i?parseInt(i==null?void 0:i.split("/")[1]):null}}}),on=(r,e)=>({async getPathForFileId(t,n={}){return(await r.propfind(W.urlJoin("meta",t,{leadingSlash:!0}),{properties:[L.DavProperty.MetaPathForUser],...n}))[0].props[L.DavProperty.MetaPathForUser]}});/*! For license information please see index.js.LICENSE.txt */var an={2:r=>{function e(o,u,l){o instanceof RegExp&&(o=t(o,l)),u instanceof RegExp&&(u=t(u,l));var i=n(o,u,l);return i&&{start:i[0],end:i[1],pre:l.slice(0,i[0]),body:l.slice(i[0]+o.length,i[1]),post:l.slice(i[1]+u.length)}}function t(o,u){var l=u.match(o);return l?l[0]:null}function n(o,u,l){var i,h,a,s,f,c=l.indexOf(o),d=l.indexOf(u,c+1),m=c;if(c>=0&&d>0){for(i=[],a=l.length;m>=0&&!f;)m==c?(i.push(m),c=l.indexOf(o,m+1)):i.length==1?f=[i.pop(),d]:((h=i.pop())<a&&(a=h,s=d),d=l.indexOf(u,m+1)),m=c<d&&c>=0?c:d;i.length&&(f=[a,s])}return f}r.exports=e,e.range=n},101:function(r,e,t){var n;r=t.nmd(r),function(o){var u=(r&&r.exports,typeof ce.global=="object"&&ce.global);u.global!==u&&u.window;var l=function(f){this.message=f};(l.prototype=new Error).name="InvalidCharacterError";var i=function(f){throw new l(f)},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=/[\t\n\f\r ]/g,s={encode:function(f){f=String(f),/[^\0-\xFF]/.test(f)&&i("The string to be encoded contains characters outside of the Latin1 range.");for(var c,d,m,g,w=f.length%3,y="",p=-1,v=f.length-w;++p<v;)c=f.charCodeAt(p)<<16,d=f.charCodeAt(++p)<<8,m=f.charCodeAt(++p),y+=h.charAt((g=c+d+m)>>18&63)+h.charAt(g>>12&63)+h.charAt(g>>6&63)+h.charAt(63&g);return w==2?(c=f.charCodeAt(p)<<8,d=f.charCodeAt(++p),y+=h.charAt((g=c+d)>>10)+h.charAt(g>>4&63)+h.charAt(g<<2&63)+"="):w==1&&(g=f.charCodeAt(p),y+=h.charAt(g>>2)+h.charAt(g<<4&63)+"=="),y},decode:function(f){var c=(f=String(f).replace(a,"")).length;c%4==0&&(c=(f=f.replace(/==?$/,"")).length),(c%4==1||/[^+a-zA-Z0-9/]/.test(f))&&i("Invalid character: the string to be decoded is not correctly encoded.");for(var d,m,g=0,w="",y=-1;++y<c;)m=h.indexOf(f.charAt(y)),d=g%4?64*d+m:m,g++%4&&(w+=String.fromCharCode(255&d>>(-2*g&6)));return w},version:"1.0.0"};(n=(function(){return s}).call(e,t,e,r))===void 0||(r.exports=n)}()},172:(r,e)=>{e.d=function(t){if(!t)return 0;for(var n=(t=t.toString()).length,o=t.length;o--;){var u=t.charCodeAt(o);56320<=u&&u<=57343&&o--,127<u&&u<=2047?n++:2047<u&&u<=65535&&(n+=2)}return n}},526:r=>{var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var n=[],o=0;o<t.length;o++)n.push(255&t.charCodeAt(o));return n},bytesToString:function(t){for(var n=[],o=0;o<t.length;o++)n.push(String.fromCharCode(t[o]));return n.join("")}}};r.exports=e},298:r=>{var e,t;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(n,o){return n<<o|n>>>32-o},rotr:function(n,o){return n<<32-o|n>>>o},endian:function(n){if(n.constructor==Number)return 16711935&t.rotl(n,8)|4278255360&t.rotl(n,24);for(var o=0;o<n.length;o++)n[o]=t.endian(n[o]);return n},randomBytes:function(n){for(var o=[];n>0;n--)o.push(Math.floor(256*Math.random()));return o},bytesToWords:function(n){for(var o=[],u=0,l=0;u<n.length;u++,l+=8)o[l>>>5]|=n[u]<<24-l%32;return o},wordsToBytes:function(n){for(var o=[],u=0;u<32*n.length;u+=8)o.push(n[u>>>5]>>>24-u%32&255);return o},bytesToHex:function(n){for(var o=[],u=0;u<n.length;u++)o.push((n[u]>>>4).toString(16)),o.push((15&n[u]).toString(16));return o.join("")},hexToBytes:function(n){for(var o=[],u=0;u<n.length;u+=2)o.push(parseInt(n.substr(u,2),16));return o},bytesToBase64:function(n){for(var o=[],u=0;u<n.length;u+=3)for(var l=n[u]<<16|n[u+1]<<8|n[u+2],i=0;i<4;i++)8*u+6*i<=8*n.length?o.push(e.charAt(l>>>6*(3-i)&63)):o.push("=");return o.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],u=0,l=0;u<n.length;l=++u%4)l!=0&&o.push((e.indexOf(n.charAt(u-1))&Math.pow(2,-2*l+8)-1)<<2*l|e.indexOf(n.charAt(u))>>>6-2*l);return o}},r.exports=t},635:(r,e,t)=>{const n=t(31),o=t(338),u=t(221);r.exports={XMLParser:o,XMLValidator:n,XMLBuilder:u}},118:r=>{r.exports=function(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const n of e)if(typeof n=="string"&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}},705:(r,e)=>{const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+t+"]["+t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+n+"$");e.isExist=function(u){return u!==void 0},e.isEmptyObject=function(u){return Object.keys(u).length===0},e.merge=function(u,l,i){if(l){const h=Object.keys(l),a=h.length;for(let s=0;s<a;s++)u[h[s]]=i==="strict"?[l[h[s]]]:l[h[s]]}},e.getValue=function(u){return e.isExist(u)?u:""},e.isName=function(u){return o.exec(u)!=null},e.getAllMatches=function(u,l){const i=[];let h=l.exec(u);for(;h;){const a=[];a.startIndex=l.lastIndex-h[0].length;const s=h.length;for(let f=0;f<s;f++)a.push(h[f]);i.push(a),h=l.exec(u)}return i},e.nameRegexp=n},31:(r,e,t)=>{const n=t(705),o={allowBooleanAttributes:!1,unpairedTags:[]};function u(p){return p===" "||p===" "||p===`
|
|
2
2
|
`||p==="\r"}function l(p,v){const A=v;for(;v<p.length;v++)if(!(p[v]!="?"&&p[v]!=" ")){const N=p.substr(A,v-A);if(v>5&&N==="xml")return m("InvalidXml","XML declaration allowed only at the start of the document.",w(p,v));if(p[v]=="?"&&p[v+1]==">"){v++;break}}return v}function i(p,v){if(p.length>v+5&&p[v+1]==="-"&&p[v+2]==="-"){for(v+=3;v<p.length;v++)if(p[v]==="-"&&p[v+1]==="-"&&p[v+2]===">"){v+=2;break}}else if(p.length>v+8&&p[v+1]==="D"&&p[v+2]==="O"&&p[v+3]==="C"&&p[v+4]==="T"&&p[v+5]==="Y"&&p[v+6]==="P"&&p[v+7]==="E"){let A=1;for(v+=8;v<p.length;v++)if(p[v]==="<")A++;else if(p[v]===">"&&(A--,A===0))break}else if(p.length>v+9&&p[v+1]==="["&&p[v+2]==="C"&&p[v+3]==="D"&&p[v+4]==="A"&&p[v+5]==="T"&&p[v+6]==="A"&&p[v+7]==="["){for(v+=8;v<p.length;v++)if(p[v]==="]"&&p[v+1]==="]"&&p[v+2]===">"){v+=2;break}}return v}e.validate=function(p,v){v=Object.assign({},o,v);const A=[];let N=!1,b=!1;p[0]==="\uFEFF"&&(p=p.substr(1));for(let x=0;x<p.length;x++)if(p[x]==="<"&&p[x+1]==="?"){if(x+=2,x=l(p,x),x.err)return x}else{if(p[x]!=="<"){if(u(p[x]))continue;return m("InvalidChar","char '"+p[x]+"' is not expected.",w(p,x))}{let T=x;if(x++,p[x]==="!"){x=i(p,x);continue}{let O=!1;p[x]==="/"&&(O=!0,x++);let I="";for(;x<p.length&&p[x]!==">"&&p[x]!==" "&&p[x]!==" "&&p[x]!==`
|
|
3
3
|
`&&p[x]!=="\r";x++)I+=p[x];if(I=I.trim(),I[I.length-1]==="/"&&(I=I.substring(0,I.length-1),x--),E=I,!n.isName(E)){let $;return $=I.trim().length===0?"Invalid space after '<'.":"Tag '"+I+"' is an invalid name.",m("InvalidTag",$,w(p,x))}const C=s(p,x);if(C===!1)return m("InvalidAttr","Attributes for '"+I+"' have open quote.",w(p,x));let P=C.value;if(x=C.index,P[P.length-1]==="/"){const $=x-P.length;P=P.substring(0,P.length-1);const F=c(P,v);if(F!==!0)return m(F.err.code,F.err.msg,w(p,$+F.err.line));N=!0}else if(O){if(!C.tagClosed)return m("InvalidTag","Closing tag '"+I+"' doesn't have proper closing.",w(p,x));if(P.trim().length>0)return m("InvalidTag","Closing tag '"+I+"' can't have attributes or invalid starting.",w(p,T));if(A.length===0)return m("InvalidTag","Closing tag '"+I+"' has not been opened.",w(p,T));{const $=A.pop();if(I!==$.tagName){let F=w(p,$.tagStartPos);return m("InvalidTag","Expected closing tag '"+$.tagName+"' (opened in line "+F.line+", col "+F.col+") instead of closing tag '"+I+"'.",w(p,T))}A.length==0&&(b=!0)}}else{const $=c(P,v);if($!==!0)return m($.err.code,$.err.msg,w(p,x-P.length+$.err.line));if(b===!0)return m("InvalidXml","Multiple possible root nodes found.",w(p,x));v.unpairedTags.indexOf(I)!==-1||A.push({tagName:I,tagStartPos:T}),N=!0}for(x++;x<p.length;x++)if(p[x]==="<"){if(p[x+1]==="!"){x++,x=i(p,x);continue}if(p[x+1]!=="?")break;if(x=l(p,++x),x.err)return x}else if(p[x]==="&"){const $=d(p,x);if($==-1)return m("InvalidChar","char '&' is not expected.",w(p,x));x=$}else if(b===!0&&!u(p[x]))return m("InvalidXml","Extra text at the end",w(p,x));p[x]==="<"&&x--}}}var E;return N?A.length==1?m("InvalidTag","Unclosed tag '"+A[0].tagName+"'.",w(p,A[0].tagStartPos)):!(A.length>0)||m("InvalidXml","Invalid '"+JSON.stringify(A.map(x=>x.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):m("InvalidXml","Start tag expected.",1)};const h='"',a="'";function s(p,v){let A="",N="",b=!1;for(;v<p.length;v++){if(p[v]===h||p[v]===a)N===""?N=p[v]:N!==p[v]||(N="");else if(p[v]===">"&&N===""){b=!0;break}A+=p[v]}return N===""&&{value:A,index:v,tagClosed:b}}const f=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function c(p,v){const A=n.getAllMatches(p,f),N={};for(let b=0;b<A.length;b++){if(A[b][1].length===0)return m("InvalidAttr","Attribute '"+A[b][2]+"' has no space in starting.",y(A[b]));if(A[b][3]!==void 0&&A[b][4]===void 0)return m("InvalidAttr","Attribute '"+A[b][2]+"' is without value.",y(A[b]));if(A[b][3]===void 0&&!v.allowBooleanAttributes)return m("InvalidAttr","boolean attribute '"+A[b][2]+"' is not allowed.",y(A[b]));const E=A[b][2];if(!g(E))return m("InvalidAttr","Attribute '"+E+"' is an invalid name.",y(A[b]));if(N.hasOwnProperty(E))return m("InvalidAttr","Attribute '"+E+"' is repeated.",y(A[b]));N[E]=1}return!0}function d(p,v){if(p[++v]===";")return-1;if(p[v]==="#")return function(N,b){let E=/\d/;for(N[b]==="x"&&(b++,E=/[\da-fA-F]/);b<N.length;b++){if(N[b]===";")return b;if(!N[b].match(E))break}return-1}(p,++v);let A=0;for(;v<p.length;v++,A++)if(!(p[v].match(/\w/)&&A<20)){if(p[v]===";")break;return-1}return v}function m(p,v,A){return{err:{code:p,msg:v,line:A.line||A,col:A.col}}}function g(p){return n.isName(p)}function w(p,v){const A=p.substring(0,v).split(/\r?\n/);return{line:A.length,col:A[A.length-1].length+1}}function y(p){return p.startIndex+p[1].length}},221:(r,e,t)=>{const n=t(87),o=t(118),u={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(s,f){return f},attributeValueProcessor:function(s,f){return f},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function l(s){this.options=Object.assign({},u,s),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=o(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=a),this.processTextOrObjNode=i,this.options.format?(this.indentate=h,this.tagEndChar=`>
|
|
4
4
|
`,this.newLine=`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const w=require("./web-client/graph/generated.cjs"),b=require("./toString-hHr716Th.cjs"),h=require("./functions-DEaUzlbB.cjs"),B=({axiosClient:a,config:n})=>{const l=w.UserApiFactory(n,n.basePath,a),i=w.UsersApiFactory(n,n.basePath,a),c=w.MeUserApiFactory(n,n.basePath,a),e=w.MeChangepasswordApiFactory(n,n.basePath,a),s=w.UserAppRoleAssignmentApiFactory(n,n.basePath,a);return{async getUser(r,t,u){const{data:d}=await l.getUser(r,t!=null&&t.select?new Set([...t.select]):null,t!=null&&t.expand?new Set([...t.expand]):new Set(["drive","memberOf","appRoleAssignments"]),u);return d},async createUser(r,t){const{data:u}=await i.createUser(r,t);return u},async editUser(r,t,u){const{data:d}=await l.updateUser(r,t,u);return d},async deleteUser(r,t,u){await l.deleteUser(r,t,u)},async listUsers(r,t){const{data:{value:u}}=await i.listUsers(r==null?void 0:r.search,r==null?void 0:r.filter,r!=null&&r.orderBy?new Set([...r.orderBy]):null,r!=null&&r.select?new Set([...r.select]):null,r!=null&&r.expand?new Set([...r.expand]):null,t);return u},async getMe(r,t){const{data:u}=await c.getOwnUser(r!=null&&r.expand?new Set([...r.expand]):new Set(["memberOf"]),t);return u},async editMe(r,t){const{data:u}=await c.updateOwnUser(r,t);return u},async changeOwnPassword(r,t){await e.changeOwnPassword(r,t)},async exportPersonalData(r,t,u){await l.exportPersonalData(r,t,u)},async createUserAppRoleAssignment(r,t,u){const{data:d}=await s.userCreateAppRoleAssignments(r,t,u);return d}}},N=({axiosClient:a,config:n})=>{const l=w.GroupApiFactory(n,n.basePath,a),i=w.GroupsApiFactory(n,n.basePath,a);return{async getGroup(c,e,s){const{data:r}=await l.getGroup(c,e!=null&&e.select?new Set([...e.select]):null,e!=null&&e.expand?new Set([...e.expand]):new Set(["members"]),s);return r},async createGroup(c,e){const{data:s}=await i.createGroup(c,e);return s},async editGroup(c,e,s){const{data:r}=await l.updateGroup(c,e,s);return r},async deleteGroup(c,e,s){await l.deleteGroup(c,e,s)},async listGroups(c,e){const{data:{value:s}}=await i.listGroups(c==null?void 0:c.search,c!=null&&c.orderBy?new Set([...c.orderBy]):null,c!=null&&c.select?new Set([...c.select]):null,c!=null&&c.expand?new Set([...c.expand]):null,e);return s},async addMember(c,e,s){await l.addMember(c,{"@odata.id":b.urlJoin(n.basePath,"v1.0","users",e)},s)},async deleteMember(c,e,s,r){await l.deleteMember(c,e,s,r)}}},L=({axiosClient:a,config:n})=>{const l=w.ApplicationsApiFactory(n,n.basePath,a);return{async getApplication(i,c){const{data:e}=await l.getApplication(i,c);return e},async listApplications(i){const{data:{value:c}}=await l.listApplications(i);return c||[]}}};function x(){}var f=b.getNative(b.root,"Set");function T(a){var n=-1,l=Array(a.size);return a.forEach(function(i){l[++n]=i}),l}var E=1/0,O=f&&1/T(new f([,-0]))[1]==E?function(a){return new f(a)}:x,W=200;function z(a,n,l){var i=-1,c=h.arrayIncludes,e=a.length,s=!0,r=[],t=r;if(e>=W){var u=O(a);if(u)return T(u);s=!1,c=h.cacheHas,t=new h.SetCache}else t=r;e:for(;++i<e;){var d=a[i],y=d;if(d=d!==0?d:0,s&&y===y){for(var m=t.length;m--;)if(t[m]===y)continue e;r.push(d)}else c(t,y,l)||(t!==r&&t.push(y),r.push(d))}return r}function j(a){return a&&a.length?z(a):[]}const U=a=>Object.hasOwn(a,"sharedWith"),J=a=>U(a)&&a.outgoing,_=a=>U(a)&&!a.outgoing,H=a=>Object.hasOwn(a,"role"),Y=a=>!Object.hasOwn(a,"role"),k=({driveItem:a,graphRoles:n})=>{var l;return(l=a.remoteItem)==null?void 0:l.permissions.reduce((i,c)=>{var e;return(e=c.roles)==null||e.forEach(s=>{const r=n[s];r&&!i.some(({id:t})=>t===r.id)&&i.push(r)}),i},[])},M=({driveItem:a,shareRoles:n})=>{var i;if(!n.length){const c=(i=a.remoteItem)==null?void 0:i.permissions.reduce((e,s)=>{const r=s["@libre.graph.permissions.actions"];return r&&e.push(...r),e},[]);return[...new Set(c)]}const l=n.reduce((c,e)=>(e.rolePermissions.forEach(s=>{c.push(...s.allowedResourceActions)}),c),[]);return[...new Set(l)]};function Q({driveItem:a,graphRoles:n,serverUrl:l}){var m,S,D,R;const i=a.name||a.remoteItem.name,c=h.extractStorageId(a.remoteItem.id),e=a.remoteItem.permissions.map(o=>{const{grantedToV2:F}=o;return{...F.group||F.user,shareType:A(o)}}),s=a.remoteItem.permissions.reduce((o,F)=>{const v=F.invitation.invitedBy.user;return o.some(({id:G})=>G===v.id)||o.push(v),o},[]);let r=j(a.remoteItem.permissions.map(A));s.some(o=>o["@libre.graph.userType"]==="Federated")&&(r=[h.ShareTypes.remote.value]);const u=k({driveItem:a,graphRoles:n}),d=M({driveItem:a,shareRoles:u}),y={id:a.id,remoteItemId:a.remoteItem.id,driveId:(m=a.parentReference)==null?void 0:m.driveId,path:"/",name:i,fileId:a.remoteItem.id,size:a.size,storageId:c,parentFolderId:(S=a.parentReference)==null?void 0:S.id,sdate:a.remoteItem.permissions[0].createdDateTime,tags:[],webDavPath:h.buildWebDavSpacesPath(a.remoteItem.id,"/"),sharedBy:s,owner:(D=a.remoteItem.createdBy)==null?void 0:D.user,sharedWith:e,shareTypes:r,isFolder:!!a.folder,type:a.folder?"folder":"file",mimeType:((R=a.file)==null?void 0:R.mimeType)||"httpd/unix-directory",mdate:a.lastModifiedDateTime?new Date(a.lastModifiedDateTime).toUTCString():void 0,syncEnabled:a["@client.synchronize"],hidden:a["@UI.Hidden"],shareRoles:u,sharePermissions:d,outgoing:!1,privateLink:b.urlJoin(l,"f",a.remoteItem.id),canRename:()=>a["@client.synchronize"],canDownload:()=>d.includes(h.GraphSharePermission.readContent),canUpload:()=>d.includes(h.GraphSharePermission.createUpload),canCreate:()=>d.includes(h.GraphSharePermission.createChildren),canBeDeleted:()=>d.includes(h.GraphSharePermission.deleteStandard),canEditTags:()=>d.includes(h.GraphSharePermission.createChildren),isMounted:()=>!1,isReceivedShare:()=>!0,canShare:()=>!1,canDeny:()=>!1,getDomSelector:()=>h.extractDomSelector(a.id)};return y.extension=h.extractExtensionFromFile(y),y}function Z({driveItem:a,user:n,serverUrl:l}){var s,r,t;const i=h.extractStorageId(a.id),c=b.urlJoin(a.parentReference.path,a.name),e={id:a.id,driveId:(s=a.parentReference)==null?void 0:s.driveId,path:c,name:a.name,fileId:a.id,size:a.size,storageId:i,parentFolderId:(r=a.parentReference)==null?void 0:r.id,sdate:a.permissions[0].createdDateTime,tags:[],webDavPath:h.buildWebDavSpacesPath(i,c),sharedBy:[{id:n.id,displayName:n.displayName}],owner:{id:n.id,displayName:n.displayName},sharedWith:a.permissions.map(u=>{if(u.link)return{id:u.id,displayName:u.link["@libre.graph.displayName"],shareType:h.ShareTypes.link.value};const d=A(u);return{...u.grantedToV2.user||u.grantedToV2.group,shareType:d}}),shareTypes:a.permissions.map(A),isFolder:!!a.folder,type:a.folder?"folder":"file",mimeType:((t=a.file)==null?void 0:t.mimeType)||"httpd/unix-directory",outgoing:!0,privateLink:b.urlJoin(l,"f",a.id),canRename:()=>!0,canDownload:()=>!0,canUpload:()=>!0,canCreate:()=>!0,canBeDeleted:()=>!0,canEditTags:()=>!0,isMounted:()=>!1,isReceivedShare:()=>!0,canShare:()=>!0,canDeny:()=>!0,getDomSelector:()=>h.extractDomSelector(a.id)};return e.extension=h.extractExtensionFromFile(e),e}function P({graphPermission:a,graphRoles:n,resourceId:l,indirect:i=!1}){var s,r,t;const c=n[(s=a.roles)==null?void 0:s[0]],e=(t=(r=a.invitation)==null?void 0:r.invitedBy)==null?void 0:t.user;return{id:a.id,resourceId:l,indirect:i,shareType:A(a),role:c,sharedBy:{id:e==null?void 0:e.id,displayName:e==null?void 0:e.displayName},sharedWith:a.grantedToV2.user||a.grantedToV2.group,permissions:a["@libre.graph.permissions.actions"]?a["@libre.graph.permissions.actions"]:c.rolePermissions.flatMap(u=>u.allowedResourceActions),createdDateTime:a.createdDateTime,expirationDateTime:a.expirationDateTime}}function g({graphPermission:a,resourceId:n,indirect:l=!1}){var c,e;const i=(e=(c=a.invitation)==null?void 0:c.invitedBy)==null?void 0:e.user;return{id:a.id,resourceId:n,indirect:l,shareType:h.ShareTypes.link.value,sharedBy:{id:i==null?void 0:i.id,displayName:i==null?void 0:i.displayName},hasPassword:a.hasPassword,createdDateTime:a.createdDateTime,expirationDateTime:a.expirationDateTime,displayName:a.link["@libre.graph.displayName"],isQuickLink:a.link["@libre.graph.quickLink"],type:a.link.type,webUrl:a.link.webUrl,preventsDownload:a.link.preventsDownload}}function A({link:a,grantedToV2:n}){var l;return a?h.ShareTypes.link.value:n!=null&&n.group?h.ShareTypes.group.value:((l=n==null?void 0:n.user)==null?void 0:l["@libre.graph.userType"])==="Federated"?h.ShareTypes.remote.value:h.ShareTypes.user.value}const p=a=>new URL(a.webUrl).origin,$=({axiosClient:a,config:n})=>{const l=w.DrivesApiFactory(n,n.basePath,a),i=new w.MeDrivesApi(n,n.basePath,a),c=new w.DrivesGetDrivesApi(n,n.basePath,a);return{async getDrive(e,s,r){const{data:t}=await l.getDrive(e,s!=null&&s.select?new Set([...s.select]):null,r);return h.buildSpace({...t,serverUrl:p(t)})},async createDrive(e,s){const{data:r}=await l.createDrive(e,s);return h.buildSpace({...r,serverUrl:p(r)})},async updateDrive(e,s,r){const{data:t}=await l.updateDrive(e,s,r);return h.buildSpace({...t,serverUrl:p(t)})},async disableDrive(e,s,r){await l.deleteDrive(e,s,r)},async deleteDrive(e,s,r){await l.deleteDrive(e,s,{headers:{...(r==null?void 0:r.headers)&&r.headers||{},Purge:"T"},...r&&{requestOptions:r}||{}})},async listMyDrives(e,s){const{data:{value:r}}=await i.listMyDrivesBeta(e==null?void 0:e.orderBy,e==null?void 0:e.filter,e==null?void 0:e.expand,e!=null&&e.select?new Set([...e.select]):null,s);return r.map(t=>h.buildSpace({...t,serverUrl:p(t)}))},async listAllDrives(e,s){const{data:{value:r}}=await c.listAllDrivesBeta(e==null?void 0:e.orderBy,e==null?void 0:e.filter,e==null?void 0:e.expand,e!=null&&e.select?new Set([...e.select]):null,s);return r.map(t=>h.buildSpace({...t,serverUrl:p(t)}))}}},K=({axiosClient:a,config:n})=>{const l=w.DriveItemApiFactory(n,n.basePath,a),i=w.DrivesRootApiFactory(n,n.basePath,a),c=w.MeDriveApiFactory(n,n.basePath,a);return{async getDriveItem(e,s,r){const{data:t}=await l.getDriveItem(e,s,r);return t},async createDriveItem(e,s,r){const{data:t}=await i.createDriveItem(e,s,r);return t},async updateDriveItem(e,s,r,t){const{data:u}=await l.updateDriveItem(e,s,r,t);return u},async deleteDriveItem(e,s,r){await l.deleteDriveItem(e,s,r)},async listSharedByMe(e){const{data:s}=await c.listSharedByMe(e);return(s==null?void 0:s.value)||[]},async listSharedWithMe(e){const{data:s}=await c.listSharedWithMe(e);return(s==null?void 0:s.value)||[]}}},X=({axiosClient:a,config:n})=>{const l=w.TagsApiFactory(n,n.basePath,a);return{async listTags(i){const{data:{value:c}}=await l.getTags(i);return c||[]},async assignTags(i,c){await l.assignTags(i,c)},async unassignTags(i,c){await l.unassignTags(i,c)}}},V=({axiosClient:a,config:n})=>{const l=w.ActivitiesApiFactory(n,n.basePath,a);return{async listActivities(i,c){const{data:{value:e}}=await l.getActivities(i,c);return e||[]}}},C=({axiosClient:a,config:n})=>{const l=w.DrivesRootApiFactory(n,n.basePath,a),i=w.RoleManagementApiFactory(n,n.basePath,a),c=w.DrivesPermissionsApiFactory(n,n.basePath,a);return{async getPermission(e,s,r,t,u){const{data:d}=await c.getPermission(e,s,r,u);return d.link?g({graphPermission:d,resourceId:s}):P({graphPermission:d,resourceId:s,graphRoles:t||{}})},async listPermissions(e,s,r,t,u){let d;if(e===s){const{data:o}=await l.listPermissionsSpaceRoot(e,t==null?void 0:t.filter,t!=null&&t.select?new Set([...t.select]):null,t==null?void 0:t.count,(t==null?void 0:t.top)||0,u);d=o}else{const{data:o}=await c.listPermissions(e,s,t==null?void 0:t.filter,t!=null&&t.select?new Set([...t.select]):null,t==null?void 0:t.count,(t==null?void 0:t.top)||0,u);d=o}const y=d.value||[],m=d["@libre.graph.permissions.actions.allowedValues"],S=d["@libre.graph.permissions.roles.allowedValues"],D=d["@odata.count"];return{shares:y.map(o=>o.link?g({graphPermission:o,resourceId:s}):P({graphPermission:o,resourceId:s,graphRoles:r||{}})),allowedActions:m,allowedRoles:S,count:D}},async updatePermission(e,s,r,t,u,d){let y;if(e===s){const{data:m}=await l.updatePermissionSpaceRoot(e,r,t,d);y=m}else{const{data:m}=await c.updatePermission(e,s,r,t,d);y=m}return y.link?g({graphPermission:y,resourceId:s}):P({graphPermission:y,resourceId:s,graphRoles:u||{}})},async deletePermission(e,s,r,t){if(e===s){await l.deletePermissionSpaceRoot(e,r,t);return}await c.deletePermission(e,s,r,t)},async createInvite(e,s,r,t,u){var y,m;let d;if(e===s){const{data:S}=await l.inviteSpaceRoot(e,r,u);d=(y=S.value)==null?void 0:y[0]}else{const{data:S}=await c.invite(e,s,r,u);d=(m=S.value)==null?void 0:m[0]}if(!d)throw new Error("no permission returned");return P({graphPermission:d,resourceId:s,graphRoles:t||{}})},async createLink(e,s,r,t){let u;if(e===s){const{data:d}=await l.createLinkSpaceRoot(e,r,t);u=d}else{const{data:d}=await c.createLink(e,s,r,t);u=d}return g({graphPermission:u,resourceId:s})},async setPermissionPassword(e,s,r,t,u){let d;if(e===s){const{data:y}=await l.setPermissionPasswordSpaceRoot(e,r,t,u);d=y}else{const{data:y}=await c.setPermissionPassword(e,s,r,t,u);d=y}return g({graphPermission:d,resourceId:s})},async listRoleDefinitions(e){const{data:s}=await i.listPermissionRoleDefinitions(e);return s}}},q=({axiosClient:a,config:n})=>{const l=w.MePhotoApiFactory(n,n.basePath,a),i=w.UserPhotoApiFactory(n,n.basePath,a);return{async getOwnUserPhoto(c){const{data:e}=await l.getOwnUserPhoto(c);return e},async deleteOwnUserPhoto(c){const{data:e}=await l.deleteOwnUserPhoto(c);return e},async updateOwnUserPhotoPatch(c,e){const{data:s}=await l.updateOwnUserPhotoPatch(c,e);return s},async getUserPhoto(c,e){const{data:s}=await i.getUserPhoto(c,e);return s}}},I=(a,n)=>{const l=new URL(a);l.pathname=[...l.pathname.split("/"),"graph"].filter(Boolean).join("/");const i=new w.Configuration({basePath:l.href});return{activities:V({axiosClient:n,config:i}),applications:L({axiosClient:n,config:i}),tags:X({axiosClient:n,config:i}),drives:$({axiosClient:n,config:i}),driveItems:K({axiosClient:n,config:i}),users:B({axiosClient:n,config:i}),groups:N({axiosClient:n,config:i}),permissions:C({axiosClient:n,config:i}),photos:q({axiosClient:n,config:i})}};exports.buildCollaboratorShare=P;exports.buildIncomingShareResource=Q;exports.buildLinkShare=g;exports.buildOutgoingShareResource=Z;exports.getShareResourcePermissions=M;exports.getShareResourceRoles=k;exports.graph=I;exports.isCollaboratorShare=H;exports.isIncomingShareResource=_;exports.isLinkShare=Y;exports.isOutgoingShareResource=J;exports.isShareResource=U;
|
|
@@ -6,7 +6,7 @@ var Hr = (r, e, t) => e in r ? zr(r, e, { enumerable: !0, configurable: !0, writ
|
|
|
6
6
|
var k = (r, e, t) => Hr(r, typeof e != "symbol" ? e + "" : e, t), Ke = (r, e, t) => e.has(r) || _t("Cannot " + t);
|
|
7
7
|
var S = (r, e, t) => (Ke(r, e, "read from private field"), t ? t.call(r) : e.get(r)), ie = (r, e, t) => e.has(r) ? _t("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), W = (r, e, t, n) => (Ke(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), ge = (r, e, t) => (Ke(r, e, "access private method"), t);
|
|
8
8
|
import { a as Zr } from "./index-BTGj2rHD.js";
|
|
9
|
-
import { C as Tt, H as je, I as $e, s as Jr, l as Ae, p as wr, m as Yr, J as de } from "./functions-
|
|
9
|
+
import { C as Tt, H as je, I as $e, s as Jr, l as Ae, p as wr, m as Yr, J as de } from "./functions-CYOnwClV.js";
|
|
10
10
|
import { u as q } from "./toString-Cn0xCZ28.js";
|
|
11
11
|
import { ocs as Kr } from "./web-client/ocs.js";
|
|
12
12
|
import { p as we, g as Ue } from "./index-Pl8khka8.js";
|