@opencloud-eu/web-client 7.1.2 → 7.3.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/axios-DvF8YTlk.js +1964 -0
- package/dist/{dist-DXLl1XQj.js → dist-CeGfU4rJ.js} +4 -3
- package/dist/{generated-Dr-mKneP.js → generated-FCm3SbzB.js} +260 -230
- package/dist/{graph-C_btwMni.js → graph-CppzmKYd.js} +72 -72
- package/dist/{helpers-B_uB5urn.js → helpers-MRfkPTnV.js} +305 -321
- package/dist/{ocs-VeFt8RO1.js → ocs-gQyxMolJ.js} +1213 -1377
- package/dist/ox-DIaYdpxw.js +3045 -0
- package/dist/src/graph/generated/api.d.ts +70 -4
- package/dist/src/helpers/resource/types.d.ts +5 -1
- package/dist/src/helpers/share/type.d.ts +1 -0
- package/dist/src/helpers/space/functions.d.ts +3 -2
- package/dist/src/helpers/space/types.d.ts +0 -3
- package/dist/src/index.d.ts +2 -1
- package/dist/src/ox/index.d.ts +27 -0
- package/dist/src/ox/types.d.ts +29 -0
- package/dist/src/sse/index.d.ts +7 -0
- package/dist/{toString-DIrlTUQN.js → toString-B4UEwRgf.js} +92 -112
- package/dist/urlJoin-_pUL1TUx.js +24 -0
- package/dist/web-client/graph/generated.js +2 -2
- package/dist/web-client/graph.js +1 -1
- package/dist/web-client/ocs.js +1 -1
- package/dist/web-client/ox.js +2 -0
- package/dist/web-client/sse.js +6 -7
- package/dist/web-client/webdav.js +3 -3
- package/dist/web-client.js +24 -6
- package/dist/{webdav-uHUUUQAP.js → webdav-BMoGCm4T.js} +112 -94
- package/package.json +7 -3
- package/dist/axios-idnwLrbl.js +0 -1862
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./axios-
|
|
2
|
-
import { n as r } from "./dist-
|
|
3
|
-
import {
|
|
4
|
-
import { E as a,
|
|
5
|
-
import { a as
|
|
1
|
+
import { n as e, r as t, t as n } from "./axios-DvF8YTlk.js";
|
|
2
|
+
import { n as r } from "./dist-CeGfU4rJ.js";
|
|
3
|
+
import { t as i } from "./urlJoin-_pUL1TUx.js";
|
|
4
|
+
import { E as a, G as o, K as s, M as c, N as l, U as u, _ as d, f } from "./helpers-MRfkPTnV.js";
|
|
5
|
+
import { a as p, i as m, n as h, r as g, t as _ } from "./ocs-gQyxMolJ.js";
|
|
6
6
|
//#region src/utils/encodePath.ts
|
|
7
|
-
var
|
|
7
|
+
var v = (e) => encodeURIComponent(e).split("%2F").join("/"), y = class extends Error {
|
|
8
|
+
response;
|
|
9
|
+
statusCode;
|
|
10
|
+
constructor(e, t, n = null) {
|
|
11
|
+
super(e), this.response = t, this.statusCode = n;
|
|
12
|
+
}
|
|
13
|
+
}, b = class extends y {
|
|
14
|
+
errorCode;
|
|
15
|
+
constructor(e, t, n, r = null) {
|
|
16
|
+
super(e, n, r), this.errorCode = t;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
8
19
|
//#endregion
|
|
9
|
-
//#region ../../node_modules/.pnpm/fast-xml-builder@1.
|
|
20
|
+
//#region ../../node_modules/.pnpm/fast-xml-builder@1.3.0/node_modules/fast-xml-builder/src/util.js
|
|
10
21
|
function x(e) {
|
|
11
22
|
return String(e).replace(/--/g, "- -").replace(/--/g, "- -").replace(/-$/, "- ");
|
|
12
23
|
}
|
|
@@ -17,7 +28,7 @@ function C(e) {
|
|
|
17
28
|
return String(e).replace(/"/g, """).replace(/'/g, "'");
|
|
18
29
|
}
|
|
19
30
|
//#endregion
|
|
20
|
-
//#region ../../node_modules/.pnpm/fast-xml-builder@1.
|
|
31
|
+
//#region ../../node_modules/.pnpm/fast-xml-builder@1.3.0/node_modules/fast-xml-builder/src/orderedJs2Xml.js
|
|
21
32
|
var ee = "\n";
|
|
22
33
|
function te(e, t) {
|
|
23
34
|
if (!Array.isArray(e) || e.length === 0) return "1.0";
|
|
@@ -32,7 +43,7 @@ function te(e, t) {
|
|
|
32
43
|
return "1.0";
|
|
33
44
|
}
|
|
34
45
|
function ne(e, t, n, r, i) {
|
|
35
|
-
return !n.sanitizeName ||
|
|
46
|
+
return !n.sanitizeName || i(e) ? e : n.sanitizeName(e, {
|
|
36
47
|
isAttribute: t,
|
|
37
48
|
matcher: r.readOnly()
|
|
38
49
|
});
|
|
@@ -43,10 +54,10 @@ function re(e, t) {
|
|
|
43
54
|
let r = [];
|
|
44
55
|
if (t.stopNodes && Array.isArray(t.stopNodes)) for (let e = 0; e < t.stopNodes.length; e++) {
|
|
45
56
|
let n = t.stopNodes[e];
|
|
46
|
-
typeof n == "string" ? r.push(new
|
|
57
|
+
typeof n == "string" ? r.push(new m(n)) : n instanceof m && r.push(n);
|
|
47
58
|
}
|
|
48
|
-
let i = te(e, t), a = new
|
|
49
|
-
return ie(e, t, n,
|
|
59
|
+
let i = te(e, t), a = p("qName", { xmlVersion: i }), o = new g();
|
|
60
|
+
return ie(e, t, n, o, r, a);
|
|
50
61
|
}
|
|
51
62
|
function ie(e, t, n, r, i, a) {
|
|
52
63
|
let o = "", s = !1;
|
|
@@ -68,16 +79,19 @@ function ie(e, t, n, r, i, a) {
|
|
|
68
79
|
let e = l[u];
|
|
69
80
|
p || (e = t.tagValueProcessor(d, e), e = ce(e, t)), s && (o += n), o += e, s = !1, r.pop();
|
|
70
81
|
continue;
|
|
71
|
-
}
|
|
82
|
+
}
|
|
83
|
+
if (d === t.cdataPropName) {
|
|
72
84
|
s && (o += n);
|
|
73
85
|
let e = l[u][0][t.textNodeName], i = S(e);
|
|
74
86
|
o += `<![CDATA[${i}]]>`, s = !1, r.pop();
|
|
75
87
|
continue;
|
|
76
|
-
}
|
|
88
|
+
}
|
|
89
|
+
if (d === t.commentPropName) {
|
|
77
90
|
let e = l[u][0][t.textNodeName], i = x(e);
|
|
78
91
|
o += n + `<!--${i}-->`, s = !0, r.pop();
|
|
79
92
|
continue;
|
|
80
|
-
}
|
|
93
|
+
}
|
|
94
|
+
if (d[0] === "?") {
|
|
81
95
|
let e = E(l[":@"], t, p, r, a);
|
|
82
96
|
o += (d === "?xml" ? "" : n) + `<${d}${e}?>`, s = !0, r.pop();
|
|
83
97
|
continue;
|
|
@@ -153,14 +167,14 @@ function ce(e, t) {
|
|
|
153
167
|
return e;
|
|
154
168
|
}
|
|
155
169
|
//#endregion
|
|
156
|
-
//#region ../../node_modules/.pnpm/fast-xml-builder@1.
|
|
170
|
+
//#region ../../node_modules/.pnpm/fast-xml-builder@1.3.0/node_modules/fast-xml-builder/src/ignoreAttributes.js
|
|
157
171
|
function le(e) {
|
|
158
172
|
return typeof e == "function" ? e : Array.isArray(e) ? (t) => {
|
|
159
173
|
for (let n of e) if (typeof n == "string" && t === n || n instanceof RegExp && n.test(t)) return !0;
|
|
160
174
|
} : () => !1;
|
|
161
175
|
}
|
|
162
176
|
//#endregion
|
|
163
|
-
//#region ../../node_modules/.pnpm/fast-xml-builder@1.
|
|
177
|
+
//#region ../../node_modules/.pnpm/fast-xml-builder@1.3.0/node_modules/fast-xml-builder/src/fxb.js
|
|
164
178
|
var ue = {
|
|
165
179
|
attributeNamePrefix: "@_",
|
|
166
180
|
attributesGroupName: !1,
|
|
@@ -213,7 +227,7 @@ var ue = {
|
|
|
213
227
|
function D(e) {
|
|
214
228
|
if (this.options = Object.assign({}, ue, e), this.options.stopNodes && Array.isArray(this.options.stopNodes) && (this.options.stopNodes = this.options.stopNodes.map((e) => typeof e == "string" && e.startsWith("*.") ? ".." + e.substring(2) : e)), this.stopNodeExpressions = [], this.options.stopNodes && Array.isArray(this.options.stopNodes)) for (let e = 0; e < this.options.stopNodes.length; e++) {
|
|
215
229
|
let t = this.options.stopNodes[e];
|
|
216
|
-
typeof t == "string" ? this.stopNodeExpressions.push(new
|
|
230
|
+
typeof t == "string" ? this.stopNodeExpressions.push(new m(t)) : t instanceof m && this.stopNodeExpressions.push(t);
|
|
217
231
|
}
|
|
218
232
|
this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
|
|
219
233
|
return !1;
|
|
@@ -234,7 +248,7 @@ function de(e, t) {
|
|
|
234
248
|
return "1.0";
|
|
235
249
|
}
|
|
236
250
|
function fe(e, t, n, r, i) {
|
|
237
|
-
return !n.sanitizeName ||
|
|
251
|
+
return !n.sanitizeName || i(e) ? e : n.sanitizeName(e, {
|
|
238
252
|
isAttribute: t,
|
|
239
253
|
matcher: r.readOnly()
|
|
240
254
|
});
|
|
@@ -243,8 +257,8 @@ D.prototype.build = function(e) {
|
|
|
243
257
|
if (this.options.preserveOrder) return re(e, this.options);
|
|
244
258
|
{
|
|
245
259
|
Array.isArray(e) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (e = { [this.options.arrayNodeName]: e });
|
|
246
|
-
let t = new
|
|
247
|
-
return this.j2x(e, 0, t,
|
|
260
|
+
let t = new g(), n = de(e, this.options), r = p("qName", { xmlVersion: n });
|
|
261
|
+
return this.j2x(e, 0, t, r).val;
|
|
248
262
|
}
|
|
249
263
|
}, D.prototype.j2x = function(e, t, n, r) {
|
|
250
264
|
let i = "", a = "";
|
|
@@ -269,7 +283,7 @@ D.prototype.build = function(e) {
|
|
|
269
283
|
let r = this.checkStopNode(n);
|
|
270
284
|
if (n.pop(), r) {
|
|
271
285
|
let n = "" + e[c];
|
|
272
|
-
n === "" ?
|
|
286
|
+
a += n === "" ? this.indentate(t) + "<" + l + this.closeTag(l) + this.tagEndChar : this.indentate(t) + "<" + l + ">" + n + "</" + l + this.tagEndChar;
|
|
273
287
|
} else a += this.buildTextValNode(e[c], l, "", t, n);
|
|
274
288
|
}
|
|
275
289
|
} else if (Array.isArray(e[c])) {
|
|
@@ -290,7 +304,7 @@ D.prototype.build = function(e) {
|
|
|
290
304
|
let e = this.checkStopNode(n);
|
|
291
305
|
if (n.pop(), e) {
|
|
292
306
|
let e = "" + i;
|
|
293
|
-
e === "" ?
|
|
307
|
+
o += e === "" ? this.indentate(t) + "<" + l + this.closeTag(l) + this.tagEndChar : this.indentate(t) + "<" + l + ">" + e + "</" + l + this.tagEndChar;
|
|
294
308
|
} else o += this.buildTextValNode(i, l, "", t, n);
|
|
295
309
|
}
|
|
296
310
|
}
|
|
@@ -348,11 +362,11 @@ D.prototype.extractAttributes = function(e) {
|
|
|
348
362
|
for (let e of r) if (typeof e == "string" || typeof e == "number") t += `<${n}>${e}</${n}>`;
|
|
349
363
|
else if (typeof e == "object" && e) {
|
|
350
364
|
let r = this.buildRawContent(e), i = this.buildAttributesForStopNode(e);
|
|
351
|
-
r === "" ?
|
|
365
|
+
t += r === "" ? `<${n}${i}/>` : `<${n}${i}>${r}</${n}>`;
|
|
352
366
|
}
|
|
353
367
|
} else if (typeof r == "object" && r) {
|
|
354
368
|
let e = this.buildRawContent(r), i = this.buildAttributesForStopNode(r);
|
|
355
|
-
e === "" ?
|
|
369
|
+
t += e === "" ? `<${n}${i}/>` : `<${n}${i}>${e}</${n}>`;
|
|
356
370
|
} else t += `<${n}>${r}</${n}>`;
|
|
357
371
|
}
|
|
358
372
|
return t;
|
|
@@ -364,14 +378,14 @@ D.prototype.extractAttributes = function(e) {
|
|
|
364
378
|
for (let e in n) {
|
|
365
379
|
if (!Object.prototype.hasOwnProperty.call(n, e)) continue;
|
|
366
380
|
let r = e.startsWith(this.options.attributeNamePrefix) ? e.substring(this.options.attributeNamePrefix.length) : e, i = n[e];
|
|
367
|
-
i === !0 && this.options.suppressBooleanAttributes ? t += " " + r : t += " " + r + "=\"" + i + "\"";
|
|
381
|
+
i === !0 && this.options.suppressBooleanAttributes ? t += " " + r : t += " " + r + "=\"" + C(i) + "\"";
|
|
368
382
|
}
|
|
369
383
|
} else for (let n in e) {
|
|
370
384
|
if (!Object.prototype.hasOwnProperty.call(e, n)) continue;
|
|
371
385
|
let r = this.isAttribute(n);
|
|
372
386
|
if (r) {
|
|
373
387
|
let i = e[n];
|
|
374
|
-
i === !0 && this.options.suppressBooleanAttributes ? t += " " + r : t += " " + r + "=\"" + i + "\"";
|
|
388
|
+
i === !0 && this.options.suppressBooleanAttributes ? t += " " + r : t += " " + r + "=\"" + C(i) + "\"";
|
|
375
389
|
}
|
|
376
390
|
}
|
|
377
391
|
return t;
|
|
@@ -380,7 +394,7 @@ D.prototype.extractAttributes = function(e) {
|
|
|
380
394
|
if (t[0] === "?") return this.indentate(r) + "<" + t + n + "?" + this.tagEndChar;
|
|
381
395
|
{
|
|
382
396
|
let i = "</" + t + this.tagEndChar, a = "";
|
|
383
|
-
return t[0] === "?" && (a = "?", i = ""), (n || n === "") && e.indexOf("<") === -1 ? this.indentate(r) + "<" + t + n + a + ">" + e + i : this.options.commentPropName !== !1 && t === this.options.commentPropName && a.length === 0 ? this.indentate(r) + `<!--${e}-->` + this.newLine : this.indentate(r) + "<" + t + n + a + this.tagEndChar + e + this.indentate(r) + i;
|
|
397
|
+
return t[0] === "?" && (a = "?", i = ""), (n || n === "") && e.indexOf("<") === -1 ? this.indentate(r) + "<" + t + n + a + ">" + e + i : this.options.commentPropName !== !1 && t === this.options.commentPropName && a.length === 0 ? this.indentate(r) + `<!--${x(e)}-->` + this.newLine : this.indentate(r) + "<" + t + n + a + this.tagEndChar + e + this.indentate(r) + i;
|
|
384
398
|
}
|
|
385
399
|
}, D.prototype.closeTag = function(e) {
|
|
386
400
|
let t = "";
|
|
@@ -393,11 +407,13 @@ D.prototype.extractAttributes = function(e) {
|
|
|
393
407
|
if (this.options.cdataPropName !== !1 && t === this.options.cdataPropName) {
|
|
394
408
|
let t = S(e);
|
|
395
409
|
return this.indentate(r) + `<![CDATA[${t}]]>` + this.newLine;
|
|
396
|
-
}
|
|
410
|
+
}
|
|
411
|
+
if (this.options.commentPropName !== !1 && t === this.options.commentPropName) {
|
|
397
412
|
let t = x(e);
|
|
398
413
|
return this.indentate(r) + `<!--${t}-->` + this.newLine;
|
|
399
|
-
}
|
|
400
|
-
|
|
414
|
+
}
|
|
415
|
+
if (t[0] === "?") return this.indentate(r) + "<" + t + n + "?" + this.tagEndChar;
|
|
416
|
+
{
|
|
401
417
|
let i = this.options.tagValueProcessor(t, e);
|
|
402
418
|
return i = this.replaceEntitiesValue(i), i === "" ? this.indentate(r) + "<" + t + n + this.closeTag(t) + this.tagEndChar : this.indentate(r) + "<" + t + n + ">" + i + "</" + t + this.tagEndChar;
|
|
403
419
|
}
|
|
@@ -415,7 +431,7 @@ function he(e) {
|
|
|
415
431
|
return e.startsWith(this.options.attributeNamePrefix) && e !== this.options.textNodeName ? e.substr(this.attrPrefixLen) : !1;
|
|
416
432
|
}
|
|
417
433
|
//#endregion
|
|
418
|
-
//#region ../../node_modules/.pnpm/fast-xml-parser@5.
|
|
434
|
+
//#region ../../node_modules/.pnpm/fast-xml-parser@5.10.1/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js
|
|
419
435
|
var ge = D, O = (e, { fileId: t, path: n, name: r }) => {
|
|
420
436
|
if (n !== void 0) return i(e.webDavPath, n);
|
|
421
437
|
if (t !== void 0) {
|
|
@@ -467,7 +483,7 @@ var ge = D, O = (e, { fileId: t, path: n, name: r }) => {
|
|
|
467
483
|
};
|
|
468
484
|
} catch (e) {
|
|
469
485
|
let { message: t, response: n } = e;
|
|
470
|
-
throw new
|
|
486
|
+
throw new y(t, n, n.status);
|
|
471
487
|
}
|
|
472
488
|
} }), be = (e, t) => ({ async getFileInfo(t, n, r) {
|
|
473
489
|
return (await e.listFiles(t, n, {
|
|
@@ -475,34 +491,34 @@ var ge = D, O = (e, { fileId: t, path: n, name: r }) => {
|
|
|
475
491
|
...r
|
|
476
492
|
})).resource;
|
|
477
493
|
} }), xe = (e, t, n, { axiosClient: r, baseUrl: a }) => ({
|
|
478
|
-
async getFileUrl(o,
|
|
479
|
-
if (
|
|
480
|
-
let e = await t.getFileContents(o,
|
|
494
|
+
async getFileUrl(o, c, { disposition: l = "attachment", version: u = null, username: d = "", ...f }) {
|
|
495
|
+
if (l === "inline") {
|
|
496
|
+
let e = await t.getFileContents(o, c, {
|
|
481
497
|
responseType: "blob",
|
|
482
|
-
...
|
|
498
|
+
...f
|
|
483
499
|
});
|
|
484
500
|
return URL.createObjectURL(e.body);
|
|
485
501
|
}
|
|
486
|
-
if (
|
|
487
|
-
if (!
|
|
488
|
-
let t = e.getFileUrl(i("meta",
|
|
489
|
-
return await
|
|
502
|
+
if (u) {
|
|
503
|
+
if (!d) throw Error("username is required for URL signing");
|
|
504
|
+
let t = e.getFileUrl(i("meta", c.fileId, "v", u));
|
|
505
|
+
return await _(a, r).signUrl(t, d);
|
|
490
506
|
}
|
|
491
|
-
if (
|
|
492
|
-
let { downloadURL:
|
|
493
|
-
return
|
|
507
|
+
if (c.downloadURL) return c.downloadURL;
|
|
508
|
+
let { downloadURL: p } = await n.getFileInfo(o, c, { davProperties: [s.DownloadURL] });
|
|
509
|
+
return p;
|
|
494
510
|
},
|
|
495
511
|
revokeUrl: (e) => {
|
|
496
512
|
e && e.startsWith("blob:") && URL.revokeObjectURL(e);
|
|
497
513
|
}
|
|
498
514
|
}), Se = (e, t) => ({ getPublicFileUrl(t, n) {
|
|
499
515
|
return e.getFileUrl(i("public-files", n));
|
|
500
|
-
} }), Ce = (e, t, n) => ({ async listFiles(n, { path: r, fileId:
|
|
516
|
+
} }), Ce = (e, t, n) => ({ async listFiles(n, { path: r, fileId: u } = {}, { depth: p = 1, davProperties: m, isTrash: h = !1, ...g } = {}) {
|
|
501
517
|
let _;
|
|
502
518
|
if (a(n)) {
|
|
503
519
|
_ = await e.propfind(i(n.webDavPath, r), {
|
|
504
|
-
depth:
|
|
505
|
-
properties:
|
|
520
|
+
depth: p,
|
|
521
|
+
properties: m || o.PublicLink,
|
|
506
522
|
...g
|
|
507
523
|
}), _.forEach((e) => {
|
|
508
524
|
e.filename = e.filename.split("/").slice(1).join("/");
|
|
@@ -510,7 +526,7 @@ var ge = D, O = (e, { fileId: t, path: n, name: r }) => {
|
|
|
510
526
|
e.filename = e.filename.split("/").slice(2).join("/");
|
|
511
527
|
});
|
|
512
528
|
let t = n.driveAlias.startsWith("ocm/") ? "ocm" : "public-link";
|
|
513
|
-
if ((!r || r === "/") &&
|
|
529
|
+
if ((!r || r === "/") && p > 0 && t === "ocm" && _[0].props[s.PublicLinkItemType] === "file" && (_ = [{
|
|
514
530
|
basename: n.fileId,
|
|
515
531
|
type: "directory",
|
|
516
532
|
filename: "",
|
|
@@ -518,49 +534,49 @@ var ge = D, O = (e, { fileId: t, path: n, name: r }) => {
|
|
|
518
534
|
}, ..._]), !r) {
|
|
519
535
|
let [r, ...i] = _;
|
|
520
536
|
return {
|
|
521
|
-
resource:
|
|
537
|
+
resource: f({
|
|
522
538
|
...r,
|
|
523
539
|
id: n.id,
|
|
524
540
|
driveAlias: n.driveAlias,
|
|
525
541
|
webDavPath: n.webDavPath,
|
|
526
542
|
publicLinkType: t
|
|
527
543
|
}),
|
|
528
|
-
children: i.map((t) =>
|
|
544
|
+
children: i.map((t) => l(t, e.extraProps))
|
|
529
545
|
};
|
|
530
546
|
}
|
|
531
|
-
let a = _.map((t) =>
|
|
547
|
+
let a = _.map((t) => l(t, e.extraProps));
|
|
532
548
|
return {
|
|
533
549
|
resource: a[0],
|
|
534
550
|
children: a.slice(1)
|
|
535
551
|
};
|
|
536
552
|
}
|
|
537
553
|
let v = async () => {
|
|
538
|
-
let e = await t.getPathForFileId(
|
|
554
|
+
let e = await t.getPathForFileId(u);
|
|
539
555
|
return this.listFiles(n, { path: e }, {
|
|
540
|
-
depth:
|
|
541
|
-
davProperties:
|
|
556
|
+
depth: p,
|
|
557
|
+
davProperties: m
|
|
542
558
|
});
|
|
543
559
|
};
|
|
544
560
|
try {
|
|
545
561
|
let t = "";
|
|
546
|
-
if (t = h ?
|
|
547
|
-
fileId:
|
|
562
|
+
if (t = h ? d(n.id) : O(n, {
|
|
563
|
+
fileId: u,
|
|
548
564
|
path: r
|
|
549
565
|
}), _ = await e.propfind(t, {
|
|
550
|
-
depth:
|
|
551
|
-
properties:
|
|
566
|
+
depth: p,
|
|
567
|
+
properties: m || o.Default,
|
|
552
568
|
...g
|
|
553
569
|
}), h) return {
|
|
554
|
-
resource:
|
|
555
|
-
children: _.slice(1).map(
|
|
570
|
+
resource: l(_[0], e.extraProps),
|
|
571
|
+
children: _.slice(1).map(c)
|
|
556
572
|
};
|
|
557
|
-
let i = _.map((t) =>
|
|
558
|
-
return
|
|
573
|
+
let i = _.map((t) => l(t, e.extraProps)), a = u === n.id;
|
|
574
|
+
return u && !a && i[0].fileId && u !== i[0].fileId ? v() : {
|
|
559
575
|
resource: i[0],
|
|
560
576
|
children: i.slice(1)
|
|
561
577
|
};
|
|
562
578
|
} catch (e) {
|
|
563
|
-
if (e.statusCode === 404 &&
|
|
579
|
+
if (e.statusCode === 404 && u) return v();
|
|
564
580
|
throw e;
|
|
565
581
|
}
|
|
566
582
|
} }), we = (e, t) => ({ moveFiles(t, { path: n, fileId: r }, i, { path: a, parentFolderId: o, name: s }, { overwrite: c, ...l } = {}) {
|
|
@@ -608,27 +624,27 @@ var ge = D, O = (e, { fileId: t, path: n, name: r }) => {
|
|
|
608
624
|
}), l = i("meta", n, "v", o, { leadingSlash: !0 }), u = i("files", c, { leadingSlash: !0 });
|
|
609
625
|
return e.copy(l, u, s);
|
|
610
626
|
} }), ke = (e, t) => ({ clearTrashBin(t, { id: n, ...r } = {}) {
|
|
611
|
-
let a =
|
|
627
|
+
let a = d(t.id);
|
|
612
628
|
return n && (a = i(a, n)), e.delete(a, r);
|
|
613
629
|
} }), Ae = (e, t) => ({ async search(t, { davProperties: n = o.Default, searchLimit: r, ...i }) {
|
|
614
|
-
let { range: a, results:
|
|
630
|
+
let { range: a, results: c } = await e.report("/spaces/", {
|
|
615
631
|
pattern: t,
|
|
616
632
|
limit: r,
|
|
617
633
|
properties: n,
|
|
618
634
|
...i
|
|
619
635
|
});
|
|
620
636
|
return {
|
|
621
|
-
resources:
|
|
622
|
-
...
|
|
623
|
-
highlights: t.props[
|
|
637
|
+
resources: c.map((t) => ({
|
|
638
|
+
...l(t, e.extraProps),
|
|
639
|
+
highlights: t.props[s.Highlights] || ""
|
|
624
640
|
})).filter((e, t, n) => n.findIndex((t) => t.id === e.id) === t),
|
|
625
641
|
totalResults: a ? parseInt(a?.split("/")[1]) : null
|
|
626
642
|
};
|
|
627
643
|
} }), je = (e, t) => ({ async getPathForFileId(t, n = {}) {
|
|
628
644
|
return (await e.propfind(i("meta", t, { leadingSlash: !0 }), {
|
|
629
|
-
properties: [
|
|
645
|
+
properties: [s.MetaPathForUser],
|
|
630
646
|
...n
|
|
631
|
-
}))[0].props[
|
|
647
|
+
}))[0].props[s.MetaPathForUser];
|
|
632
648
|
} });
|
|
633
649
|
//#endregion
|
|
634
650
|
//#region ../../node_modules/.pnpm/webdav@5.9.0/node_modules/webdav/dist/web/index.js
|
|
@@ -1325,7 +1341,7 @@ function Ie(e) {
|
|
|
1325
1341
|
if (!Le(e)) throw Error("Parameter was not an error");
|
|
1326
1342
|
}
|
|
1327
1343
|
function Le(e) {
|
|
1328
|
-
return !!e && typeof e == "object" && (t = e, Object.prototype.toString.call(t)
|
|
1344
|
+
return !!e && typeof e == "object" && (t = e, Object.prototype.toString.call(t) === "[object Error]") || e instanceof Error;
|
|
1329
1345
|
var t;
|
|
1330
1346
|
}
|
|
1331
1347
|
var A = class e extends Error {
|
|
@@ -1392,7 +1408,7 @@ function M() {
|
|
|
1392
1408
|
var t = [];
|
|
1393
1409
|
if (e.length === 0) return "";
|
|
1394
1410
|
if (typeof e[0] != "string") throw TypeError("Url must be a string. Received " + e[0]);
|
|
1395
|
-
e[0].match(/^[^/:]+:\/*$/) && e.length > 1 && (e[0] = e.shift() + e[0]), e[0].match(/^file:\/\/\//) ? e[0]
|
|
1411
|
+
e[0].match(/^[^/:]+:\/*$/) && e.length > 1 && (e[0] = e.shift() + e[0]), e[0] = e[0].match(/^file:\/\/\//) ? e[0].replace(/^([^/:]+):\/*/, "$1:///") : e[0].replace(/^([^/:]+):\/*/, "$1://");
|
|
1396
1412
|
for (var n = 0; n < e.length; n++) {
|
|
1397
1413
|
var r = e[n];
|
|
1398
1414
|
if (typeof r != "string") throw TypeError("Url must be a string. Received " + r);
|
|
@@ -1751,13 +1767,13 @@ var St = k(285), Ct = (e) => {
|
|
|
1751
1767
|
}, Ot = function(e) {
|
|
1752
1768
|
let { windowsPathsNoEscape: t = !1 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1753
1769
|
return t ? e.replace(/\[([^\/\\])\]/g, "$1") : e.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
1754
|
-
}, kt = new Set([
|
|
1770
|
+
}, kt = /* @__PURE__ */ new Set([
|
|
1755
1771
|
"!",
|
|
1756
1772
|
"?",
|
|
1757
1773
|
"+",
|
|
1758
1774
|
"*",
|
|
1759
1775
|
"@"
|
|
1760
|
-
]), At = (e) => kt.has(e), jt = "(?!\\.)", Mt = new Set(["[", "."]), Nt = new Set(["..", "."]), Pt = /* @__PURE__ */ new Set("().*{}+?[]^$\\!"), Ft = "[^/]", It = "[^/]*?", Lt = "[^/]+?", Rt = class e {
|
|
1776
|
+
]), At = (e) => kt.has(e), jt = "(?!\\.)", Mt = /* @__PURE__ */ new Set(["[", "."]), Nt = /* @__PURE__ */ new Set(["..", "."]), Pt = /* @__PURE__ */ new Set("().*{}+?[]^$\\!"), Ft = "[^/]", It = "[^/]*?", Lt = "[^/]+?", Rt = class e {
|
|
1761
1777
|
type;
|
|
1762
1778
|
#e;
|
|
1763
1779
|
#t;
|
|
@@ -1780,7 +1796,7 @@ var St = k(285), Ct = (e) => {
|
|
|
1780
1796
|
return this.#t;
|
|
1781
1797
|
}
|
|
1782
1798
|
toString() {
|
|
1783
|
-
return this.#l === void 0 ? this
|
|
1799
|
+
return this.#l === void 0 ? this.#l = this.type ? this.type + "(" + this.#r.map(((e) => String(e))).join("|") + ")" : this.#r.map(((e) => String(e))).join("") : this.#l;
|
|
1784
1800
|
}
|
|
1785
1801
|
#d() {
|
|
1786
1802
|
if (this !== this.#e) throw Error("should only call on root");
|
|
@@ -2937,7 +2953,7 @@ function Hn(e, t, n) {
|
|
|
2937
2953
|
if (s === void 0) continue;
|
|
2938
2954
|
if (o[s]) {
|
|
2939
2955
|
let e = Hn(o[s], t, c), n = Gn(e, t);
|
|
2940
|
-
o[Bn] !== void 0 && (e[Bn] = o[Bn]), o[":@"] ? Wn(e, o[":@"], c, t) : Object.keys(e).length !== 1 || e[t.textNodeName] === void 0 || t.alwaysCreateTextNode ? Object.keys(e).length === 0 && (t.alwaysCreateTextNode ? e[t.textNodeName] = "" : e = "") : e = e[t.textNodeName], i[s] !== void 0 && i.hasOwnProperty(s) ? (Array.isArray(i[s]) || (i[s] = [i[s]]), i[s].push(e)) : t.isArray(s, c, n) ?
|
|
2956
|
+
o[Bn] !== void 0 && (e[Bn] = o[Bn]), o[":@"] ? Wn(e, o[":@"], c, t) : Object.keys(e).length !== 1 || e[t.textNodeName] === void 0 || t.alwaysCreateTextNode ? Object.keys(e).length === 0 && (t.alwaysCreateTextNode ? e[t.textNodeName] = "" : e = "") : e = e[t.textNodeName], i[s] !== void 0 && i.hasOwnProperty(s) ? (Array.isArray(i[s]) || (i[s] = [i[s]]), i[s].push(e)) : i[s] = t.isArray(s, c, n) ? [e] : e;
|
|
2941
2957
|
}
|
|
2942
2958
|
}
|
|
2943
2959
|
}
|
|
@@ -2955,7 +2971,7 @@ function Wn(e, t, n, r) {
|
|
|
2955
2971
|
let i = Object.keys(t), a = i.length;
|
|
2956
2972
|
for (let o = 0; o < a; o++) {
|
|
2957
2973
|
let a = i[o];
|
|
2958
|
-
r.isArray(a, n + "." + a, !0, !0) ?
|
|
2974
|
+
e[a] = r.isArray(a, n + "." + a, !0, !0) ? [t[a]] : t[a];
|
|
2959
2975
|
}
|
|
2960
2976
|
}
|
|
2961
2977
|
}
|
|
@@ -2972,7 +2988,7 @@ function qn(e) {
|
|
|
2972
2988
|
}
|
|
2973
2989
|
function Jn(e, t) {
|
|
2974
2990
|
let n = t;
|
|
2975
|
-
for (; t < e.length; t++) if (
|
|
2991
|
+
for (; t < e.length; t++) if (e[t] == "?" || e[t] == " ") {
|
|
2976
2992
|
let r = e.substr(n, t - n);
|
|
2977
2993
|
if (t > 5 && r === "xml") return K("InvalidXml", "XML declaration allowed only at the start of the document.", q(e, t));
|
|
2978
2994
|
if (e[t] == "?" && e[t + 1] == ">") {
|
|
@@ -4222,20 +4238,20 @@ function mi(e) {
|
|
|
4222
4238
|
};
|
|
4223
4239
|
}
|
|
4224
4240
|
//#endregion
|
|
4225
|
-
//#region ../../node_modules/.pnpm/uuid@14.0.
|
|
4241
|
+
//#region ../../node_modules/.pnpm/uuid@14.0.1/node_modules/uuid/dist/stringify.js
|
|
4226
4242
|
var $ = [];
|
|
4227
4243
|
for (let e = 0; e < 256; ++e) $.push((e + 256).toString(16).slice(1));
|
|
4228
4244
|
function hi(e, t = 0) {
|
|
4229
4245
|
return ($[e[t + 0]] + $[e[t + 1]] + $[e[t + 2]] + $[e[t + 3]] + "-" + $[e[t + 4]] + $[e[t + 5]] + "-" + $[e[t + 6]] + $[e[t + 7]] + "-" + $[e[t + 8]] + $[e[t + 9]] + "-" + $[e[t + 10]] + $[e[t + 11]] + $[e[t + 12]] + $[e[t + 13]] + $[e[t + 14]] + $[e[t + 15]]).toLowerCase();
|
|
4230
4246
|
}
|
|
4231
4247
|
//#endregion
|
|
4232
|
-
//#region ../../node_modules/.pnpm/uuid@14.0.
|
|
4233
|
-
var gi = new Uint8Array(16);
|
|
4248
|
+
//#region ../../node_modules/.pnpm/uuid@14.0.1/node_modules/uuid/dist/rng.js
|
|
4249
|
+
var gi = /* @__PURE__ */ new Uint8Array(16);
|
|
4234
4250
|
function _i() {
|
|
4235
4251
|
return crypto.getRandomValues(gi);
|
|
4236
4252
|
}
|
|
4237
4253
|
//#endregion
|
|
4238
|
-
//#region ../../node_modules/.pnpm/uuid@14.0.
|
|
4254
|
+
//#region ../../node_modules/.pnpm/uuid@14.0.1/node_modules/uuid/dist/v4.js
|
|
4239
4255
|
function vi(e, t, n) {
|
|
4240
4256
|
return !t && !e && crypto.randomUUID ? crypto.randomUUID() : yi(e, t, n);
|
|
4241
4257
|
}
|
|
@@ -4255,8 +4271,10 @@ function yi(e, t, n) {
|
|
|
4255
4271
|
var bi = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => t.includes(e) ? [e, n || ""] : [o.DavNamespace.includes(e) ? `d:${e}` : `oc:${e}`, n || ""])), xi = (e = [], { pattern: t, filterRules: n, limit: r = 0, extraProps: i = [] }) => {
|
|
4256
4272
|
let a = "d:propfind";
|
|
4257
4273
|
t && (a = "oc:search-files"), n && (a = "oc:filter-files");
|
|
4258
|
-
let o =
|
|
4259
|
-
|
|
4274
|
+
let o = e.reduce((e, t) => Object.assign(e, { [t]: null }), {});
|
|
4275
|
+
for (let e of i) e in o || (o[e] = null);
|
|
4276
|
+
let s = bi(o, i), c = { [a]: {
|
|
4277
|
+
"d:prop": s,
|
|
4260
4278
|
"@@xmlns:d": "DAV:",
|
|
4261
4279
|
"@@xmlns:oc": "http://owncloud.org/ns",
|
|
4262
4280
|
...t && { "oc:search": {
|
|
@@ -4270,7 +4288,7 @@ var bi = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => t.includ
|
|
|
4270
4288
|
ignoreAttributes: !1,
|
|
4271
4289
|
attributeNamePrefix: "@@",
|
|
4272
4290
|
suppressEmptyNode: !0
|
|
4273
|
-
}).build(
|
|
4291
|
+
}).build(c);
|
|
4274
4292
|
}, Si = (e) => {
|
|
4275
4293
|
let t = { "d:propertyupdate": {
|
|
4276
4294
|
"d:set": { "d:prop": bi(e, []) },
|
|
@@ -4302,7 +4320,7 @@ var bi = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => t.includ
|
|
|
4302
4320
|
return r.props.name && (r.props.name = r.props.name.toString()), r;
|
|
4303
4321
|
});
|
|
4304
4322
|
}, Ti = (e) => {
|
|
4305
|
-
let t = new
|
|
4323
|
+
let t = new h(), n = {
|
|
4306
4324
|
message: "Unknown error",
|
|
4307
4325
|
errorCode: void 0
|
|
4308
4326
|
};
|
|
@@ -4364,7 +4382,7 @@ var bi = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => t.includ
|
|
|
4364
4382
|
};
|
|
4365
4383
|
}
|
|
4366
4384
|
copy(e, t, { overwrite: n = !1, headers: r = {}, ...a } = {}) {
|
|
4367
|
-
let o = i(this.davPath,
|
|
4385
|
+
let o = i(this.davPath, v(t));
|
|
4368
4386
|
return this.request(e, {
|
|
4369
4387
|
method: u.copy,
|
|
4370
4388
|
headers: {
|
|
@@ -4376,7 +4394,7 @@ var bi = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => t.includ
|
|
|
4376
4394
|
});
|
|
4377
4395
|
}
|
|
4378
4396
|
move(e, t, { overwrite: n = !1, headers: r = {}, ...a } = {}) {
|
|
4379
|
-
let o = i(this.davPath,
|
|
4397
|
+
let o = i(this.davPath, v(t));
|
|
4380
4398
|
return this.request(e, {
|
|
4381
4399
|
method: u.move,
|
|
4382
4400
|
headers: {
|
|
@@ -4412,7 +4430,7 @@ var bi = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => t.includ
|
|
|
4412
4430
|
});
|
|
4413
4431
|
}
|
|
4414
4432
|
getFileUrl(e) {
|
|
4415
|
-
return i(this.davPath,
|
|
4433
|
+
return i(this.davPath, v(e));
|
|
4416
4434
|
}
|
|
4417
4435
|
buildHeaders(e = {}) {
|
|
4418
4436
|
return {
|
|
@@ -4424,7 +4442,7 @@ var bi = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => t.includ
|
|
|
4424
4442
|
};
|
|
4425
4443
|
}
|
|
4426
4444
|
async request(e, t) {
|
|
4427
|
-
let n = i(this.davPath,
|
|
4445
|
+
let n = i(this.davPath, v(e), { leadingSlash: !0 }), r = {
|
|
4428
4446
|
...t,
|
|
4429
4447
|
url: n,
|
|
4430
4448
|
headers: this.buildHeaders(t.headers || {})
|
|
@@ -4438,14 +4456,14 @@ var bi = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => t.includ
|
|
|
4438
4456
|
};
|
|
4439
4457
|
} catch (e) {
|
|
4440
4458
|
let { response: t } = e, n = Ti(await t.text());
|
|
4441
|
-
throw new
|
|
4459
|
+
throw new b(n.message, n.errorCode, t, t.status);
|
|
4442
4460
|
}
|
|
4443
4461
|
}
|
|
4444
4462
|
}, Di = (e, t) => ({ async listFileVersions(t, n = {}) {
|
|
4445
4463
|
let [r, ...a] = await e.propfind(i("meta", t, "v", { leadingSlash: !0 }), n);
|
|
4446
|
-
return a.map((t) =>
|
|
4464
|
+
return a.map((t) => l(t, e.extraProps));
|
|
4447
4465
|
} }), Oi = (e, t) => ({ setFavorite(t, { path: n }, r, a = {}) {
|
|
4448
|
-
let o = { [
|
|
4466
|
+
let o = { [s.IsFavorite]: r ? "true" : "false" };
|
|
4449
4467
|
return e.propPatch(i(t.webDavPath, n), o, a);
|
|
4450
4468
|
} }), ki = (e, t) => {
|
|
4451
4469
|
let r = n.create();
|
|
@@ -4483,4 +4501,4 @@ var bi = (e, t) => Object.fromEntries(Object.entries(e).map(([e, n]) => t.includ
|
|
|
4483
4501
|
};
|
|
4484
4502
|
};
|
|
4485
4503
|
//#endregion
|
|
4486
|
-
export { b as n, ki as t };
|
|
4504
|
+
export { v as i, b as n, y as r, ki as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencloud-eu/web-client",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "OpenCloud web client",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"private": false,
|
|
@@ -35,6 +35,10 @@
|
|
|
35
35
|
"default": "./dist/web-client/ocs.js",
|
|
36
36
|
"types": "./dist/src/ocs/index.d.ts"
|
|
37
37
|
},
|
|
38
|
+
"./ox": {
|
|
39
|
+
"default": "./dist/web-client/ox.js",
|
|
40
|
+
"types": "./dist/src/ox/index.d.ts"
|
|
41
|
+
},
|
|
38
42
|
"./sse": {
|
|
39
43
|
"default": "./dist/web-client/sse.js",
|
|
40
44
|
"types": "./dist/src/sse/index.d.ts"
|
|
@@ -56,13 +60,13 @@
|
|
|
56
60
|
"zod": "^4.3.6"
|
|
57
61
|
},
|
|
58
62
|
"devDependencies": {
|
|
59
|
-
"@types/luxon": "3.7.
|
|
63
|
+
"@types/luxon": "3.7.2",
|
|
60
64
|
"@types/node": "^25.5.0",
|
|
61
65
|
"vite": "^8.0.3",
|
|
62
66
|
"vite-plugin-node-polyfills": "0.28.0"
|
|
63
67
|
},
|
|
64
68
|
"scripts": {
|
|
65
|
-
"generate-openapi": "rm -rf src/graph/generated && docker run --rm -v \"${PWD}/src/graph:/local\" openapitools/openapi-generator-cli generate -i https://raw.githubusercontent.com/opencloud-eu/libre-graph-api/main/api/openapi-spec/v1.0.yaml -g typescript-axios -o /local/generated",
|
|
69
|
+
"generate-openapi": "rm -rf src/graph/generated && docker run --rm -v \"${PWD}/src/graph:/local\" openapitools/openapi-generator-cli:v7.23.0 generate -i https://raw.githubusercontent.com/opencloud-eu/libre-graph-api/main/api/openapi-spec/v1.0.yaml -g typescript-axios -o /local/generated",
|
|
66
70
|
"vite": "vite",
|
|
67
71
|
"build": "vite build && vue-tsc --project tsconfig.build.json",
|
|
68
72
|
"check:types": "vue-tsc --declaration --noEmit --project tsconfig.build.json"
|