@opencloud-eu/web-client 0.1.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.
Files changed (112) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +95 -0
  3. package/dist/functions-CsnDdpYv.js +1232 -0
  4. package/dist/functions-ikwhAVhP.cjs +1 -0
  5. package/dist/index-C1H-OgNf.cjs +6 -0
  6. package/dist/index-C6VnMvgz.cjs +6 -0
  7. package/dist/index-DbVGtwLH.cjs +1 -0
  8. package/dist/index-DqVarwg_.js +1705 -0
  9. package/dist/index-Pl8khka8.js +1141 -0
  10. package/dist/index-VvbQMSOr.js +4651 -0
  11. package/dist/index-eFi29SPG.cjs +16 -0
  12. package/dist/index-oQ7995oB.js +672 -0
  13. package/dist/src/errors.d.ts +10 -0
  14. package/dist/src/graph/activities/activities.d.ts +3 -0
  15. package/dist/src/graph/activities/index.d.ts +2 -0
  16. package/dist/src/graph/activities/types.d.ts +5 -0
  17. package/dist/src/graph/applications/applications.d.ts +3 -0
  18. package/dist/src/graph/applications/index.d.ts +2 -0
  19. package/dist/src/graph/applications/types.d.ts +6 -0
  20. package/dist/src/graph/driveItems/driveItems.d.ts +3 -0
  21. package/dist/src/graph/driveItems/index.d.ts +2 -0
  22. package/dist/src/graph/driveItems/types.d.ts +10 -0
  23. package/dist/src/graph/drives/drives.d.ts +3 -0
  24. package/dist/src/graph/drives/index.d.ts +2 -0
  25. package/dist/src/graph/drives/types.d.ts +18 -0
  26. package/dist/src/graph/generated/api.d.ts +6506 -0
  27. package/dist/src/graph/generated/base.d.ts +55 -0
  28. package/dist/src/graph/generated/common.d.ts +54 -0
  29. package/dist/src/graph/generated/configuration.d.ts +91 -0
  30. package/dist/src/graph/generated/index.d.ts +13 -0
  31. package/dist/src/graph/groups/groups.d.ts +3 -0
  32. package/dist/src/graph/groups/index.d.ts +2 -0
  33. package/dist/src/graph/groups/types.d.ts +19 -0
  34. package/dist/src/graph/index.d.ts +20 -0
  35. package/dist/src/graph/permissions/index.d.ts +2 -0
  36. package/dist/src/graph/permissions/permissions.d.ts +3 -0
  37. package/dist/src/graph/permissions/types.d.ts +23 -0
  38. package/dist/src/graph/tags/index.d.ts +2 -0
  39. package/dist/src/graph/tags/tags.d.ts +3 -0
  40. package/dist/src/graph/tags/types.d.ts +7 -0
  41. package/dist/src/graph/types.d.ts +11 -0
  42. package/dist/src/graph/users/index.d.ts +2 -0
  43. package/dist/src/graph/users/types.d.ts +25 -0
  44. package/dist/src/graph/users/users.d.ts +3 -0
  45. package/dist/src/helpers/call.d.ts +1 -0
  46. package/dist/src/helpers/httpError.d.ts +9 -0
  47. package/dist/src/helpers/index.d.ts +7 -0
  48. package/dist/src/helpers/item.d.ts +3 -0
  49. package/dist/src/helpers/publicLink/functions.d.ts +2 -0
  50. package/dist/src/helpers/publicLink/index.d.ts +1 -0
  51. package/dist/src/helpers/resource/functions.d.ts +12 -0
  52. package/dist/src/helpers/resource/index.d.ts +2 -0
  53. package/dist/src/helpers/resource/types.d.ts +103 -0
  54. package/dist/src/helpers/share/constants.d.ts +9 -0
  55. package/dist/src/helpers/share/functions.d.ts +37 -0
  56. package/dist/src/helpers/share/index.d.ts +4 -0
  57. package/dist/src/helpers/share/type.d.ts +32 -0
  58. package/dist/src/helpers/share/types.d.ts +72 -0
  59. package/dist/src/helpers/space/functions.d.ts +27 -0
  60. package/dist/src/helpers/space/index.d.ts +2 -0
  61. package/dist/src/helpers/space/types.d.ts +84 -0
  62. package/dist/src/index.d.ts +19 -0
  63. package/dist/src/ocs/capabilities.d.ts +181 -0
  64. package/dist/src/ocs/index.d.ts +8 -0
  65. package/dist/src/ocs/urlSign.d.ts +18 -0
  66. package/dist/src/sse/index.d.ts +50 -0
  67. package/dist/src/utils/encodePath.d.ts +1 -0
  68. package/dist/src/utils/index.d.ts +2 -0
  69. package/dist/src/utils/urlJoin.d.ts +19 -0
  70. package/dist/src/webdav/clearTrashBin.d.ts +10 -0
  71. package/dist/src/webdav/client/builders.d.ts +8 -0
  72. package/dist/src/webdav/client/dav.d.ts +53 -0
  73. package/dist/src/webdav/client/index.d.ts +3 -0
  74. package/dist/src/webdav/client/parsers.d.ts +8 -0
  75. package/dist/src/webdav/constants/dav.d.ts +106 -0
  76. package/dist/src/webdav/constants/index.d.ts +1 -0
  77. package/dist/src/webdav/copyFiles.d.ts +15 -0
  78. package/dist/src/webdav/createFolder.d.ts +14 -0
  79. package/dist/src/webdav/deleteFile.d.ts +8 -0
  80. package/dist/src/webdav/getFileContents.d.ts +17 -0
  81. package/dist/src/webdav/getFileInfo.d.ts +9 -0
  82. package/dist/src/webdav/getFileUrl.d.ts +15 -0
  83. package/dist/src/webdav/getPathForFileId.d.ts +5 -0
  84. package/dist/src/webdav/getPublicFileUrl.d.ts +6 -0
  85. package/dist/src/webdav/index.d.ts +7 -0
  86. package/dist/src/webdav/listFavoriteFiles.d.ts +12 -0
  87. package/dist/src/webdav/listFileVersions.d.ts +5 -0
  88. package/dist/src/webdav/listFiles.d.ts +21 -0
  89. package/dist/src/webdav/moveFiles.d.ts +15 -0
  90. package/dist/src/webdav/putFileContents.d.ts +18 -0
  91. package/dist/src/webdav/restoreFile.d.ts +12 -0
  92. package/dist/src/webdav/restoreFileVersion.d.ts +10 -0
  93. package/dist/src/webdav/search.d.ts +15 -0
  94. package/dist/src/webdav/setFavorite.d.ts +8 -0
  95. package/dist/src/webdav/types.d.ts +47 -0
  96. package/dist/src/webdav/utils.d.ts +13 -0
  97. package/dist/toString-Cn0xCZ28.js +261 -0
  98. package/dist/toString-hHr716Th.cjs +1 -0
  99. package/dist/vite.config.d.ts +2 -0
  100. package/dist/web-client/graph/generated.cjs +1 -0
  101. package/dist/web-client/graph/generated.js +5499 -0
  102. package/dist/web-client/graph.cjs +1 -0
  103. package/dist/web-client/graph.js +5 -0
  104. package/dist/web-client/ocs.cjs +25 -0
  105. package/dist/web-client/ocs.js +6014 -0
  106. package/dist/web-client/sse.cjs +2 -0
  107. package/dist/web-client/sse.js +218 -0
  108. package/dist/web-client/webdav.cjs +1 -0
  109. package/dist/web-client/webdav.js +10 -0
  110. package/dist/web-client.cjs +1 -0
  111. package/dist/web-client.js +99 -0
  112. package/package.json +67 -0
@@ -0,0 +1,2 @@
1
+ "use strict";var _=Object.defineProperty;var F=(t,e,n)=>e in t?_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var i=(t,e,n)=>F(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function M(t,e){const n=t.getReader();let r;for(;!(r=await n.read()).done;)e(r.value)}function j(t){let e,n,r,o=!1;return function(s){e===void 0?(e=s,n=0,r=-1):e=x(e,s);const a=e.length;let c=0;for(;n<a;){o&&(e[n]===10&&(c=++n),o=!1);let d=-1;for(;n<a&&d===-1;++n)switch(e[n]){case 58:r===-1&&(r=n-c);break;case 13:o=!0;case 10:d=n;break}if(d===-1)break;t(e.subarray(c,d),r),c=n,r=-1}c===a?e=void 0:c!==0&&(e=e.subarray(c),n-=c)}}function U(t,e,n){let r=E();const o=new TextDecoder;return function(s,a){if(s.length===0)n==null||n(r),r=E();else if(a>0){const c=o.decode(s.subarray(0,a)),d=a+(s[a+1]===32?2:1),h=o.decode(s.subarray(d));switch(c){case"data":r.data=r.data?r.data+`
2
+ `+h:h;break;case"event":r.event=h;break;case"id":t(r.id=h);break;case"retry":const f=parseInt(h,10);isNaN(f)||e(r.retry=f);break}}}}function x(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function E(){return{data:"",event:"",id:"",retry:void 0}}var K=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n};const C="text/event-stream",B=1e3,R="last-event-id";function V(t,e){var{signal:n,headers:r,onopen:o,onmessage:u,onclose:s,onerror:a,openWhenHidden:c,fetch:d}=e,h=K(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((f,T)=>{const p=Object.assign({},r);p.accept||(p.accept=C);let v;function L(){v.abort(),document.hidden||m()}c||document.addEventListener("visibilitychange",L);let D=B,O=0;function g(){document.removeEventListener("visibilitychange",L),window.clearTimeout(O),v.abort()}n==null||n.addEventListener("abort",()=>{g(),f()});const H=d??window.fetch,A=o??W;async function m(){var w;v=new AbortController;try{const b=await H(t,Object.assign(Object.assign({},h),{headers:p,signal:v.signal}));await A(b),await M(b.body,j(U(l=>{l?p[R]=l:delete p[R]},l=>{D=l},u))),s==null||s(),g(),f()}catch(b){if(!v.signal.aborted)try{const l=(w=a==null?void 0:a(b))!==null&&w!==void 0?w:D;window.clearTimeout(O),O=window.setTimeout(m,l)}catch(l){g(),T(l)}}}m()})}function W(t){const e=t.headers.get("content-type");if(!(e!=null&&e.startsWith(C)))throw new Error(`Expected content-type to be ${C}, Actual: ${e}`)}var N=(t=>(t.NOTIFICATION="userlog-notification",t.POSTPROCESSING_FINISHED="postprocessing-finished",t.FILE_LOCKED="file-locked",t.FILE_UNLOCKED="file-unlocked",t.FILE_TOUCHED="file-touched",t.ITEM_RENAMED="item-renamed",t.ITEM_TRASHED="item-trashed",t.ITEM_RESTORED="item-restored",t.ITEM_MOVED="item-moved",t.FOLDER_CREATED="folder-created",t.SPACE_MEMBER_ADDED="space-member-added",t.SPACE_MEMBER_REMOVED="space-member-removed",t.SPACE_SHARE_UPDATED="space-share-updated",t.SHARE_CREATED="share-created",t.SHARE_REMOVED="share-removed",t.SHARE_UPDATED="share-updated",t.LINK_CREATED="link-created",t.LINK_REMOVED="link-removed",t.LINK_UPDATED="link-updated",t.BACKCHANNEL_LOGOUT="backchannel-logout",t))(N||{});class I extends Error{constructor(){super(...arguments);i(this,"name","RetriableError")}}const $=15e3;class k{constructor(e,n){i(this,"url");i(this,"fetchOptions");i(this,"abortController");i(this,"eventListenerMap");i(this,"readyState");i(this,"withCredentials");i(this,"CONNECTING");i(this,"OPEN");i(this,"CLOSED");i(this,"onerror");i(this,"onmessage");i(this,"onopen");this.url=e,this.fetchOptions=n,this.abortController=new AbortController,this.eventListenerMap={},this.readyState=this.CONNECTING,this.connect()}connect(){return V(this.url,{openWhenHidden:!0,signal:this.abortController.signal,fetch:this.fetchProvider.bind(this),onopen:async()=>{var n;const e=new Event("open");(n=this.onopen)==null||n.bind(this)(e),this.readyState=this.OPEN},onmessage:e=>{var u;const n=new MessageEvent("message",{data:e.data});(u=this.onmessage)==null||u.bind(this)(n);const r=e.event,o=this.eventListenerMap[r];o==null||o.forEach(s=>s(n))},onclose:()=>{throw this.readyState=this.CLOSED,new I},onerror:e=>{var r;console.error(e);const n=new CustomEvent("error",{detail:e});return(r=this.onerror)==null||r.bind(this)(n),3e4+Math.floor(Math.random()*$)}})}fetchProvider(...e){const[n,r]=e,o={...r,...this.fetchOptions};return window.fetch(n,o)}close(){this.abortController.abort("closed")}addEventListener(e,n){this.eventListenerMap[e]=this.eventListenerMap[e]||[],this.eventListenerMap[e].push(n)}removeEventListener(e,n){var r;this.eventListenerMap[e]=(r=this.eventListenerMap[e])==null?void 0:r.filter(o=>o!==n)}dispatchEvent(){throw new Error("Method not implemented.")}updateAccessToken(e){this.fetchOptions.headers.Authorization=`Bearer ${e}`}updateLanguage(e){this.fetchOptions.headers["Accept-Language"]=e,this.close(),this.connect()}}let y=null;const q=(t,e)=>(y||(y=new k(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse",t).href,e)),y);exports.MESSAGE_TYPE=N;exports.RetriableError=I;exports.SSEAdapter=k;exports.sse=q;
@@ -0,0 +1,218 @@
1
+ var H = Object.defineProperty;
2
+ var T = (t, e, n) => e in t ? H(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var i = (t, e, n) => T(t, typeof e != "symbol" ? e + "" : e, n);
4
+ async function A(t, e) {
5
+ const n = t.getReader();
6
+ let r;
7
+ for (; !(r = await n.read()).done; )
8
+ e(r.value);
9
+ }
10
+ function F(t) {
11
+ let e, n, r, o = !1;
12
+ return function(s) {
13
+ e === void 0 ? (e = s, n = 0, r = -1) : e = U(e, s);
14
+ const a = e.length;
15
+ let c = 0;
16
+ for (; n < a; ) {
17
+ o && (e[n] === 10 && (c = ++n), o = !1);
18
+ let d = -1;
19
+ for (; n < a && d === -1; ++n)
20
+ switch (e[n]) {
21
+ case 58:
22
+ r === -1 && (r = n - c);
23
+ break;
24
+ case 13:
25
+ o = !0;
26
+ case 10:
27
+ d = n;
28
+ break;
29
+ }
30
+ if (d === -1)
31
+ break;
32
+ t(e.subarray(c, d), r), c = n, r = -1;
33
+ }
34
+ c === a ? e = void 0 : c !== 0 && (e = e.subarray(c), n -= c);
35
+ };
36
+ }
37
+ function _(t, e, n) {
38
+ let r = R();
39
+ const o = new TextDecoder();
40
+ return function(s, a) {
41
+ if (s.length === 0)
42
+ n == null || n(r), r = R();
43
+ else if (a > 0) {
44
+ const c = o.decode(s.subarray(0, a)), d = a + (s[a + 1] === 32 ? 2 : 1), h = o.decode(s.subarray(d));
45
+ switch (c) {
46
+ case "data":
47
+ r.data = r.data ? r.data + `
48
+ ` + h : h;
49
+ break;
50
+ case "event":
51
+ r.event = h;
52
+ break;
53
+ case "id":
54
+ t(r.id = h);
55
+ break;
56
+ case "retry":
57
+ const f = parseInt(h, 10);
58
+ isNaN(f) || e(r.retry = f);
59
+ break;
60
+ }
61
+ }
62
+ };
63
+ }
64
+ function U(t, e) {
65
+ const n = new Uint8Array(t.length + e.length);
66
+ return n.set(t), n.set(e, t.length), n;
67
+ }
68
+ function R() {
69
+ return {
70
+ data: "",
71
+ event: "",
72
+ id: "",
73
+ retry: void 0
74
+ };
75
+ }
76
+ var j = function(t, e) {
77
+ var n = {};
78
+ for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
79
+ if (t != null && typeof Object.getOwnPropertySymbols == "function")
80
+ for (var o = 0, r = Object.getOwnPropertySymbols(t); o < r.length; o++)
81
+ e.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[o]) && (n[r[o]] = t[r[o]]);
82
+ return n;
83
+ };
84
+ const C = "text/event-stream", x = 1e3, N = "last-event-id";
85
+ function M(t, e) {
86
+ var { signal: n, headers: r, onopen: o, onmessage: u, onclose: s, onerror: a, openWhenHidden: c, fetch: d } = e, h = j(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
87
+ return new Promise((f, I) => {
88
+ const p = Object.assign({}, r);
89
+ p.accept || (p.accept = C);
90
+ let v;
91
+ function L() {
92
+ v.abort(), document.hidden || w();
93
+ }
94
+ c || document.addEventListener("visibilitychange", L);
95
+ let D = x, O = 0;
96
+ function g() {
97
+ document.removeEventListener("visibilitychange", L), window.clearTimeout(O), v.abort();
98
+ }
99
+ n == null || n.addEventListener("abort", () => {
100
+ g(), f();
101
+ });
102
+ const E = d ?? window.fetch, k = o ?? K;
103
+ async function w() {
104
+ var m;
105
+ v = new AbortController();
106
+ try {
107
+ const b = await E(t, Object.assign(Object.assign({}, h), { headers: p, signal: v.signal }));
108
+ await k(b), await A(b.body, F(_((l) => {
109
+ l ? p[N] = l : delete p[N];
110
+ }, (l) => {
111
+ D = l;
112
+ }, u))), s == null || s(), g(), f();
113
+ } catch (b) {
114
+ if (!v.signal.aborted)
115
+ try {
116
+ const l = (m = a == null ? void 0 : a(b)) !== null && m !== void 0 ? m : D;
117
+ window.clearTimeout(O), O = window.setTimeout(w, l);
118
+ } catch (l) {
119
+ g(), I(l);
120
+ }
121
+ }
122
+ }
123
+ w();
124
+ });
125
+ }
126
+ function K(t) {
127
+ const e = t.headers.get("content-type");
128
+ if (!(e != null && e.startsWith(C)))
129
+ throw new Error(`Expected content-type to be ${C}, Actual: ${e}`);
130
+ }
131
+ var B = /* @__PURE__ */ ((t) => (t.NOTIFICATION = "userlog-notification", t.POSTPROCESSING_FINISHED = "postprocessing-finished", t.FILE_LOCKED = "file-locked", t.FILE_UNLOCKED = "file-unlocked", t.FILE_TOUCHED = "file-touched", t.ITEM_RENAMED = "item-renamed", t.ITEM_TRASHED = "item-trashed", t.ITEM_RESTORED = "item-restored", t.ITEM_MOVED = "item-moved", t.FOLDER_CREATED = "folder-created", t.SPACE_MEMBER_ADDED = "space-member-added", t.SPACE_MEMBER_REMOVED = "space-member-removed", t.SPACE_SHARE_UPDATED = "space-share-updated", t.SHARE_CREATED = "share-created", t.SHARE_REMOVED = "share-removed", t.SHARE_UPDATED = "share-updated", t.LINK_CREATED = "link-created", t.LINK_REMOVED = "link-removed", t.LINK_UPDATED = "link-updated", t.BACKCHANNEL_LOGOUT = "backchannel-logout", t))(B || {});
132
+ class V extends Error {
133
+ constructor() {
134
+ super(...arguments);
135
+ i(this, "name", "RetriableError");
136
+ }
137
+ }
138
+ const W = 15e3;
139
+ class $ {
140
+ constructor(e, n) {
141
+ i(this, "url");
142
+ i(this, "fetchOptions");
143
+ i(this, "abortController");
144
+ i(this, "eventListenerMap");
145
+ i(this, "readyState");
146
+ i(this, "withCredentials");
147
+ i(this, "CONNECTING");
148
+ i(this, "OPEN");
149
+ i(this, "CLOSED");
150
+ i(this, "onerror");
151
+ i(this, "onmessage");
152
+ i(this, "onopen");
153
+ this.url = e, this.fetchOptions = n, this.abortController = new AbortController(), this.eventListenerMap = {}, this.readyState = this.CONNECTING, this.connect();
154
+ }
155
+ connect() {
156
+ return M(this.url, {
157
+ openWhenHidden: !0,
158
+ signal: this.abortController.signal,
159
+ fetch: this.fetchProvider.bind(this),
160
+ // eslint-disable-next-line require-await
161
+ onopen: async () => {
162
+ var n;
163
+ const e = new Event("open");
164
+ (n = this.onopen) == null || n.bind(this)(e), this.readyState = this.OPEN;
165
+ },
166
+ onmessage: (e) => {
167
+ var u;
168
+ const n = new MessageEvent("message", { data: e.data });
169
+ (u = this.onmessage) == null || u.bind(this)(n);
170
+ const r = e.event, o = this.eventListenerMap[r];
171
+ o == null || o.forEach((s) => s(n));
172
+ },
173
+ onclose: () => {
174
+ throw this.readyState = this.CLOSED, new V();
175
+ },
176
+ onerror: (e) => {
177
+ var r;
178
+ console.error(e);
179
+ const n = new CustomEvent("error", { detail: e });
180
+ return (r = this.onerror) == null || r.bind(this)(n), 3e4 + Math.floor(Math.random() * W);
181
+ }
182
+ });
183
+ }
184
+ fetchProvider(...e) {
185
+ const [n, r] = e, o = { ...r, ...this.fetchOptions };
186
+ return window.fetch(n, o);
187
+ }
188
+ close() {
189
+ this.abortController.abort("closed");
190
+ }
191
+ addEventListener(e, n) {
192
+ this.eventListenerMap[e] = this.eventListenerMap[e] || [], this.eventListenerMap[e].push(n);
193
+ }
194
+ removeEventListener(e, n) {
195
+ var r;
196
+ this.eventListenerMap[e] = (r = this.eventListenerMap[e]) == null ? void 0 : r.filter((o) => o !== n);
197
+ }
198
+ dispatchEvent() {
199
+ throw new Error("Method not implemented.");
200
+ }
201
+ updateAccessToken(e) {
202
+ this.fetchOptions.headers.Authorization = `Bearer ${e}`;
203
+ }
204
+ updateLanguage(e) {
205
+ this.fetchOptions.headers["Accept-Language"] = e, this.close(), this.connect();
206
+ }
207
+ }
208
+ let y = null;
209
+ const z = (t, e) => (y || (y = new $(
210
+ new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse", t).href,
211
+ e
212
+ )), y);
213
+ export {
214
+ B as MESSAGE_TYPE,
215
+ V as RetriableError,
216
+ $ as SSEAdapter,
217
+ z as sse
218
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../index-C1H-OgNf.cjs");const r=require("../index-eFi29SPG.cjs"),e=require("../functions-ikwhAVhP.cjs");exports.webdav=r.webdav;exports.DavMethod=e.DavMethod;exports.DavPermission=e.DavPermission;exports.DavProperties=e.DavProperties;exports.DavProperty=e.DavProperty;
@@ -0,0 +1,10 @@
1
+ import "../index-DqVarwg_.js";
2
+ import { w as e } from "../index-VvbQMSOr.js";
3
+ import { K as t, L as p, I as v, J as i } from "../functions-CsnDdpYv.js";
4
+ export {
5
+ t as DavMethod,
6
+ p as DavPermission,
7
+ v as DavProperties,
8
+ i as DavProperty,
9
+ e as webdav
10
+ };
@@ -0,0 +1 @@
1
+ "use strict";var P=Object.defineProperty;var D=(r,a,c)=>a in r?P(r,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):r[a]=c;var o=(r,a,c)=>D(r,typeof a!="symbol"?a+"":a,c);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DbVGtwLH.cjs"),g=require("./web-client/ocs.cjs"),i=require("./index-eFi29SPG.cjs"),e=require("./functions-ikwhAVhP.cjs"),I=require("./toString-hHr716Th.cjs"),m=function*(r){return yield r},v=({message:r,statusCode:a,xReqId:c})=>{const u=new Response(void 0,{headers:{"x-request-id":c},status:a});return new i.HttpError(r,u,a)};class s{}o(s,"Internal",0),o(s,"Read",1),o(s,"Update",2),o(s,"Create",4),o(s,"Delete",8),o(s,"Share",16);const E=({axiosClient:r,baseURI:a})=>{const c=()=>{var S,d,h,b,p,R;const u=(d=(S=r.defaults)==null?void 0:S.headers)==null?void 0:d.Authorization,n=(b=(h=r.defaults)==null?void 0:h.headers)==null?void 0:b["Accept-Language"],l=(R=(p=r.defaults)==null?void 0:p.headers)==null?void 0:R["Initiator-ID"];return{...u&&{Authorization:u.toString()},...n&&{"Accept-Language":n.toString()},...l&&{"Initiator-ID":l.toString()}}};return{graph:t.graph(a,r),ocs:g.ocs(a,r),webdav:i.webdav(a,c)}};exports.buildCollaboratorShare=t.buildCollaboratorShare;exports.buildIncomingShareResource=t.buildIncomingShareResource;exports.buildLinkShare=t.buildLinkShare;exports.buildOutgoingShareResource=t.buildOutgoingShareResource;exports.getShareResourcePermissions=t.getShareResourcePermissions;exports.getShareResourceRoles=t.getShareResourceRoles;exports.graph=t.graph;exports.isCollaboratorShare=t.isCollaboratorShare;exports.isIncomingShareResource=t.isIncomingShareResource;exports.isLinkShare=t.isLinkShare;exports.isOutgoingShareResource=t.isOutgoingShareResource;exports.isShareResource=t.isShareResource;exports.ocs=g.ocs;exports.DavHttpError=i.DavHttpError;exports.HttpError=i.HttpError;exports.encodePath=i.encodePath;exports.webdav=i.webdav;exports.GraphSharePermission=e.GraphSharePermission;exports.OCM_PROVIDER_ID=e.OCM_PROVIDER_ID;exports.SHARE_JAIL_ID=e.SHARE_JAIL_ID;exports.ShareType=e.ShareType;exports.ShareTypes=e.ShareTypes;exports.buildDeletedResource=e.buildDeletedResource;exports.buildPublicSpaceResource=e.buildPublicSpaceResource;exports.buildResource=e.buildResource;exports.buildShareSpaceResource=e.buildShareSpaceResource;exports.buildSpace=e.buildSpace;exports.buildSpaceImageResource=e.buildSpaceImageResource;exports.buildWebDavOcmPath=e.buildWebDavOcmPath;exports.buildWebDavPublicPath=e.buildWebDavPublicPath;exports.buildWebDavSpacesPath=e.buildWebDavSpacesPath;exports.buildWebDavSpacesTrashPath=e.buildWebDavSpacesTrashPath;exports.extractDomSelector=e.extractDomSelector;exports.extractExtensionFromFile=e.extractExtensionFromFile;exports.extractNameWithoutExtension=e.extractNameWithoutExtension;exports.extractNodeId=e.extractNodeId;exports.extractParentFolderName=e.extractParentFolderName;exports.extractStorageId=e.extractStorageId;exports.getPermissionsForSpaceMember=e.getPermissionsForSpaceMember;exports.getRelativeSpecialFolderSpacePath=e.getRelativeSpecialFolderSpacePath;exports.getSpaceManagers=e.getSpaceManagers;exports.isMountPointSpaceResource=e.isMountPointSpaceResource;exports.isPersonalSpaceResource=e.isPersonalSpaceResource;exports.isProjectSpaceResource=e.isProjectSpaceResource;exports.isPublicSpaceResource=e.isPublicSpaceResource;exports.isSearchResource=e.isSearchResource;exports.isShareRoot=e.isShareRoot;exports.isShareSpaceResource=e.isShareSpaceResource;exports.isSpaceResource=e.isSpaceResource;exports.isTrashResource=e.isTrashResource;exports.urlJoin=I.urlJoin;exports.SharePermissionBit=s;exports.call=m;exports.client=E;exports.createHttpError=v;
@@ -0,0 +1,99 @@
1
+ var h = Object.defineProperty;
2
+ var b = (e, a, s) => a in e ? h(e, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[a] = s;
3
+ var r = (e, a, s) => b(e, typeof a != "symbol" ? a + "" : a, s);
4
+ import { g } from "./index-oQ7995oB.js";
5
+ import { k as O, h as F, l as L, j as W, f as k, e as y, c as M, b as T, d as _, a as j, i as z } from "./index-oQ7995oB.js";
6
+ import { ocs as R } from "./web-client/ocs.js";
7
+ import { H as m, w as D } from "./index-VvbQMSOr.js";
8
+ import { D as q, e as G } from "./index-VvbQMSOr.js";
9
+ import { G as V, O as C, x as K, S as Q, n as X, m as Y, s as Z, l as $, t as U, u as B, v as ee, a as ae, b as se, o as re, p as te, e as oe, h as ce, g as ue, f as ie, j as ne, d as de, w as le, q as pe, r as Se, C as he, z as be, A as ge, D as Re, c as me, k as De, B as fe, y as Ie, i as Pe } from "./functions-CsnDdpYv.js";
10
+ import { u as xe } from "./toString-Cn0xCZ28.js";
11
+ const x = function* (e) {
12
+ return yield e;
13
+ }, H = ({
14
+ message: e,
15
+ statusCode: a,
16
+ xReqId: s
17
+ }) => {
18
+ const o = new Response(void 0, {
19
+ headers: { "x-request-id": s },
20
+ status: a
21
+ });
22
+ return new m(e, o, a);
23
+ };
24
+ class t {
25
+ }
26
+ r(t, "Internal", 0), r(t, "Read", 1), r(t, "Update", 2), r(t, "Create", 4), r(t, "Delete", 8), r(t, "Share", 16);
27
+ const w = ({ axiosClient: e, baseURI: a }) => {
28
+ const s = () => {
29
+ var i, n, d, l, p, S;
30
+ const o = (n = (i = e.defaults) == null ? void 0 : i.headers) == null ? void 0 : n.Authorization, c = (l = (d = e.defaults) == null ? void 0 : d.headers) == null ? void 0 : l["Accept-Language"], u = (S = (p = e.defaults) == null ? void 0 : p.headers) == null ? void 0 : S["Initiator-ID"];
31
+ return {
32
+ ...o && { Authorization: o.toString() },
33
+ ...c && { "Accept-Language": c.toString() },
34
+ ...u && { "Initiator-ID": u.toString() }
35
+ };
36
+ };
37
+ return {
38
+ graph: g(a, e),
39
+ ocs: R(a, e),
40
+ webdav: D(a, s)
41
+ };
42
+ };
43
+ export {
44
+ q as DavHttpError,
45
+ V as GraphSharePermission,
46
+ m as HttpError,
47
+ C as OCM_PROVIDER_ID,
48
+ K as SHARE_JAIL_ID,
49
+ t as SharePermissionBit,
50
+ Q as ShareType,
51
+ X as ShareTypes,
52
+ O as buildCollaboratorShare,
53
+ Y as buildDeletedResource,
54
+ F as buildIncomingShareResource,
55
+ L as buildLinkShare,
56
+ W as buildOutgoingShareResource,
57
+ Z as buildPublicSpaceResource,
58
+ $ as buildResource,
59
+ U as buildShareSpaceResource,
60
+ B as buildSpace,
61
+ ee as buildSpaceImageResource,
62
+ ae as buildWebDavOcmPath,
63
+ se as buildWebDavPublicPath,
64
+ re as buildWebDavSpacesPath,
65
+ te as buildWebDavSpacesTrashPath,
66
+ x as call,
67
+ w as client,
68
+ H as createHttpError,
69
+ G as encodePath,
70
+ oe as extractDomSelector,
71
+ ce as extractExtensionFromFile,
72
+ ue as extractNameWithoutExtension,
73
+ ie as extractNodeId,
74
+ ne as extractParentFolderName,
75
+ de as extractStorageId,
76
+ le as getPermissionsForSpaceMember,
77
+ pe as getRelativeSpecialFolderSpacePath,
78
+ k as getShareResourcePermissions,
79
+ y as getShareResourceRoles,
80
+ Se as getSpaceManagers,
81
+ g as graph,
82
+ M as isCollaboratorShare,
83
+ T as isIncomingShareResource,
84
+ _ as isLinkShare,
85
+ he as isMountPointSpaceResource,
86
+ j as isOutgoingShareResource,
87
+ be as isPersonalSpaceResource,
88
+ ge as isProjectSpaceResource,
89
+ Re as isPublicSpaceResource,
90
+ me as isSearchResource,
91
+ z as isShareResource,
92
+ De as isShareRoot,
93
+ fe as isShareSpaceResource,
94
+ Ie as isSpaceResource,
95
+ Pe as isTrashResource,
96
+ R as ocs,
97
+ xe as urlJoin,
98
+ D as webdav
99
+ };
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@opencloud-eu/web-client",
3
+ "version": "0.1.0",
4
+ "description": "OpenCloud web client",
5
+ "license": "AGPL-3.0",
6
+ "private": false,
7
+ "type": "module",
8
+ "author": "OpenCloud GmbH <info@opencloud.eu>",
9
+ "homepage": "https://github.com/opencloud-eu/web/tree/main/packages/web-client",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/opencloud-eu/web",
13
+ "directory": "packages/web-client"
14
+ },
15
+ "files": [
16
+ "dist/"
17
+ ],
18
+ "publishConfig": {
19
+ "directory": "package",
20
+ "linkDirectory": false
21
+ },
22
+ "exports": {
23
+ ".": {
24
+ "default": "./dist/web-client.js",
25
+ "require": "./dist/web-client.cjs",
26
+ "types": "./dist/src/index.d.ts"
27
+ },
28
+ "./graph": {
29
+ "default": "./dist/web-client/graph.js",
30
+ "require": "./dist/web-client/graph.cjs",
31
+ "types": "./dist/src/graph/index.d.ts"
32
+ },
33
+ "./graph/generated": {
34
+ "default": "./dist/web-client/graph/generated.js",
35
+ "require": "./dist/web-client/graph/generated.cjs",
36
+ "types": "./dist/src/graph/generated/index.d.ts"
37
+ },
38
+ "./ocs": {
39
+ "default": "./dist/web-client/ocs.js",
40
+ "require": "./dist/web-client/ocs.cjs",
41
+ "types": "./dist/src/ocs/index.d.ts"
42
+ },
43
+ "./sse": {
44
+ "default": "./dist/web-client/sse.js",
45
+ "require": "./dist/web-client/sse.cjs",
46
+ "types": "./dist/src/sse/index.d.ts"
47
+ },
48
+ "./webdav": {
49
+ "default": "./dist/web-client/webdav.js",
50
+ "require": "./dist/web-client/webdav.cjs",
51
+ "types": "./dist/src/webdav/index.d.ts"
52
+ }
53
+ },
54
+ "dependencies": {
55
+ "@casl/ability": "^6.7.1",
56
+ "@microsoft/fetch-event-source": "^2.0.1",
57
+ "axios": "^1.7.7",
58
+ "fast-xml-parser": "^4.5.0",
59
+ "lodash-es": "^4.17.21",
60
+ "luxon": "^3.5.0",
61
+ "uuid": "^11.0.0",
62
+ "webdav": "^5.7.1",
63
+ "xml-js": "^1.6.11",
64
+ "zod": "^3.23.8"
65
+ },
66
+ "scripts": {}
67
+ }