@opencloud-eu/web-client 8.0.0 → 8.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.
- package/dist/{axios-ULsDSF3p.js → axios-CiL7Z3dm.js} +2 -2
- package/dist/{dist-WdVfmT0d.js → dist-p2k0FYjB.js} +1 -1
- package/dist/{generated-CkfYRFme.js → generated-5SvS30Rr.js} +350 -324
- package/dist/{graph-D3q1149Y.js → graph-u53S3WT9.js} +92 -92
- package/dist/{helpers-C_9em2wB.js → helpers-CrYtf7Ol.js} +3 -3
- package/dist/{ocs-CGD-4vGl.js → ocs-CDSkdguM.js} +149 -149
- package/dist/{ox-D1FgExd1.js → schemas-BlxXwTjV.js} +1375 -1265
- package/dist/src/graph/generated/api.d.ts +112 -24
- package/dist/src/helpers/resource/types.d.ts +1 -1
- package/dist/src/sse/index.d.ts +12 -0
- package/dist/{toString-DfgrQ1mh.js → toString-CVetDRwx.js} +1 -1
- 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 +49 -2
- package/dist/web-client/sse.js +57 -48
- package/dist/web-client/webdav.js +2 -2
- package/dist/web-client.js +5 -5
- package/dist/webdav-BdeuuZHv.js +6422 -0
- package/package.json +3 -3
- package/dist/webdav-BxsiETq0.js +0 -4538
package/dist/web-client/sse.js
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
+
import { a as e, i as t, n } from "../schemas-BlxXwTjV.js";
|
|
1
2
|
//#region ../../node_modules/.pnpm/@microsoft+fetch-event-source@2.0.1/node_modules/@microsoft/fetch-event-source/lib/esm/parse.js
|
|
2
|
-
async function
|
|
3
|
+
async function r(e, t) {
|
|
3
4
|
let n = e.getReader(), r;
|
|
4
5
|
for (; !(r = await n.read()).done;) t(r.value);
|
|
5
6
|
}
|
|
6
|
-
function
|
|
7
|
-
let t, n,
|
|
8
|
-
return function(
|
|
9
|
-
t === void 0 ? (t =
|
|
7
|
+
function i(e) {
|
|
8
|
+
let t, n, r, i = !1;
|
|
9
|
+
return function(a) {
|
|
10
|
+
t === void 0 ? (t = a, n = 0, r = -1) : t = o(t, a);
|
|
10
11
|
let s = t.length, c = 0;
|
|
11
12
|
for (; n < s;) {
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
for (; n < s &&
|
|
13
|
+
i &&= (t[n] === 10 && (c = ++n), !1);
|
|
14
|
+
let a = -1;
|
|
15
|
+
for (; n < s && a === -1; ++n) switch (t[n]) {
|
|
15
16
|
case 58:
|
|
16
|
-
|
|
17
|
+
r === -1 && (r = n - c);
|
|
17
18
|
break;
|
|
18
|
-
case 13:
|
|
19
|
-
case 10:
|
|
19
|
+
case 13: i = !0;
|
|
20
|
+
case 10: a = n;
|
|
20
21
|
}
|
|
21
|
-
if (
|
|
22
|
-
e(t.subarray(c,
|
|
22
|
+
if (a === -1) break;
|
|
23
|
+
e(t.subarray(c, a), r), c = n, r = -1;
|
|
23
24
|
}
|
|
24
25
|
c === s ? t = void 0 : c !== 0 && (t = t.subarray(c), n -= c);
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
let r =
|
|
29
|
-
return function(
|
|
30
|
-
if (
|
|
31
|
-
else if (
|
|
32
|
-
let n =
|
|
28
|
+
function a(e, t, n) {
|
|
29
|
+
let r = s(), i = new TextDecoder();
|
|
30
|
+
return function(a, o) {
|
|
31
|
+
if (a.length === 0) n?.(r), r = s();
|
|
32
|
+
else if (o > 0) {
|
|
33
|
+
let n = i.decode(a.subarray(0, o)), s = o + (a[o + 1] === 32 ? 2 : 1), c = i.decode(a.subarray(s));
|
|
33
34
|
switch (n) {
|
|
34
35
|
case "data":
|
|
35
36
|
r.data = r.data ? r.data + "\n" + c : c;
|
|
@@ -47,11 +48,11 @@ function n(e, t, n) {
|
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function o(e, t) {
|
|
51
52
|
let n = new Uint8Array(e.length + t.length);
|
|
52
53
|
return n.set(e), n.set(t, e.length), n;
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
+
function s() {
|
|
55
56
|
return {
|
|
56
57
|
data: "",
|
|
57
58
|
event: "",
|
|
@@ -61,14 +62,14 @@ function i() {
|
|
|
61
62
|
}
|
|
62
63
|
//#endregion
|
|
63
64
|
//#region ../../node_modules/.pnpm/@microsoft+fetch-event-source@2.0.1/node_modules/@microsoft/fetch-event-source/lib/esm/fetch.js
|
|
64
|
-
var
|
|
65
|
+
var c = function(e, t) {
|
|
65
66
|
var n = {};
|
|
66
67
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
67
68
|
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++) t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
|
|
68
69
|
return n;
|
|
69
|
-
},
|
|
70
|
-
function
|
|
71
|
-
var { signal:
|
|
70
|
+
}, l = "text/event-stream", u = 1e3, d = "last-event-id";
|
|
71
|
+
function f(e, t) {
|
|
72
|
+
var { signal: n, headers: o, onopen: s, onmessage: f, onclose: m, onerror: h, openWhenHidden: g, fetch: _ } = t, v = c(t, [
|
|
72
73
|
"signal",
|
|
73
74
|
"headers",
|
|
74
75
|
"onopen",
|
|
@@ -78,57 +79,65 @@ function l(r, i) {
|
|
|
78
79
|
"openWhenHidden",
|
|
79
80
|
"fetch"
|
|
80
81
|
]);
|
|
81
|
-
return new Promise((
|
|
82
|
-
let y = Object.assign({},
|
|
83
|
-
y.accept ||=
|
|
82
|
+
return new Promise((t, c) => {
|
|
83
|
+
let y = Object.assign({}, o);
|
|
84
|
+
y.accept ||= l;
|
|
84
85
|
let b;
|
|
85
86
|
function x() {
|
|
86
87
|
b.abort(), document.hidden || D();
|
|
87
88
|
}
|
|
88
89
|
g || document.addEventListener("visibilitychange", x);
|
|
89
|
-
let S =
|
|
90
|
+
let S = u, C = 0;
|
|
90
91
|
function w() {
|
|
91
92
|
document.removeEventListener("visibilitychange", x), window.clearTimeout(C), b.abort();
|
|
92
93
|
}
|
|
93
|
-
|
|
94
|
-
w(),
|
|
94
|
+
n?.addEventListener("abort", () => {
|
|
95
|
+
w(), t();
|
|
95
96
|
});
|
|
96
|
-
let T = _ ?? window.fetch, E =
|
|
97
|
+
let T = _ ?? window.fetch, E = s ?? p;
|
|
97
98
|
async function D() {
|
|
98
99
|
b = new AbortController();
|
|
99
100
|
try {
|
|
100
|
-
let
|
|
101
|
+
let n = await T(e, Object.assign(Object.assign({}, v), {
|
|
101
102
|
headers: y,
|
|
102
103
|
signal: b.signal
|
|
103
104
|
}));
|
|
104
|
-
await E(
|
|
105
|
-
e ? y[
|
|
105
|
+
await E(n), await r(n.body, i(a((e) => {
|
|
106
|
+
e ? y[d] = e : delete y[d];
|
|
106
107
|
}, (e) => {
|
|
107
108
|
S = e;
|
|
108
|
-
},
|
|
109
|
+
}, f))), m?.(), w(), t();
|
|
109
110
|
} catch (e) {
|
|
110
111
|
if (!b.signal.aborted) try {
|
|
111
112
|
let t = h?.(e) ?? S;
|
|
112
113
|
window.clearTimeout(C), C = window.setTimeout(D, t);
|
|
113
114
|
} catch (e) {
|
|
114
|
-
w(),
|
|
115
|
+
w(), c(e);
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
119
|
D();
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
+
function p(e) {
|
|
122
123
|
let t = e.headers.get("content-type");
|
|
123
|
-
if (!t?.startsWith("text/event-stream")) throw Error(`Expected content-type to be ${
|
|
124
|
+
if (!t?.startsWith("text/event-stream")) throw Error(`Expected content-type to be ${l}, Actual: ${t}`);
|
|
124
125
|
}
|
|
125
126
|
//#endregion
|
|
126
127
|
//#region src/sse/index.ts
|
|
127
|
-
var
|
|
128
|
+
var m = t({
|
|
129
|
+
itemid: e().optional(),
|
|
130
|
+
parentitemid: e().optional(),
|
|
131
|
+
spaceid: e().optional(),
|
|
132
|
+
initiatorid: e().optional(),
|
|
133
|
+
etag: e().optional(),
|
|
134
|
+
affecteduserids: n(e()).optional().nullable(),
|
|
135
|
+
sessionid: e().optional()
|
|
136
|
+
}), h = /* @__PURE__ */ function(e) {
|
|
128
137
|
return e.NOTIFICATION = "userlog-notification", e.POSTPROCESSING_FINISHED = "postprocessing-finished", e.FILE_LOCKED = "file-locked", e.FILE_UNLOCKED = "file-unlocked", e.FILE_TOUCHED = "file-touched", e.ITEM_RENAMED = "item-renamed", e.ITEM_TRASHED = "item-trashed", e.ITEM_RESTORED = "item-restored", e.ITEM_MOVED = "item-moved", e.ITEM_FAVORITE_ADDED = "item-favorite-added", e.ITEM_FAVORITE_REMOVED = "item-favorite-removed", e.FOLDER_CREATED = "folder-created", e.SPACE_CREATED = "space-created", e.SPACE_DISABLED = "space-disabled", e.SPACE_ENABLED = "space-enabled", e.SPACE_DELETED = "space-deleted", e.SPACE_MEMBER_ADDED = "space-member-added", e.SPACE_MEMBER_REMOVED = "space-member-removed", e.SPACE_SHARE_UPDATED = "space-share-updated", e.SHARE_CREATED = "share-created", e.SHARE_REMOVED = "share-removed", e.SHARE_UPDATED = "share-updated", e.LINK_CREATED = "link-created", e.LINK_REMOVED = "link-removed", e.LINK_UPDATED = "link-updated", e.BACKCHANNEL_LOGOUT = "backchannel-logout", e;
|
|
129
|
-
}({}),
|
|
138
|
+
}({}), g = class extends Error {
|
|
130
139
|
name = "RetriableError";
|
|
131
|
-
},
|
|
140
|
+
}, _ = 15e3, v = class {
|
|
132
141
|
url;
|
|
133
142
|
fetchOptions;
|
|
134
143
|
abortController;
|
|
@@ -145,7 +154,7 @@ var d = /* @__PURE__ */ function(e) {
|
|
|
145
154
|
this.url = e, this.fetchOptions = t, this.abortController = new AbortController(), this.eventListenerMap = {}, this.readyState = this.CONNECTING, this.connect();
|
|
146
155
|
}
|
|
147
156
|
connect() {
|
|
148
|
-
return
|
|
157
|
+
return f(this.url, {
|
|
149
158
|
openWhenHidden: !0,
|
|
150
159
|
signal: this.abortController.signal,
|
|
151
160
|
fetch: this.fetchProvider.bind(this),
|
|
@@ -160,12 +169,12 @@ var d = /* @__PURE__ */ function(e) {
|
|
|
160
169
|
this.eventListenerMap[n]?.forEach((e) => e(t));
|
|
161
170
|
},
|
|
162
171
|
onclose: () => {
|
|
163
|
-
throw this.readyState = this.CLOSED, new
|
|
172
|
+
throw this.readyState = this.CLOSED, new g();
|
|
164
173
|
},
|
|
165
174
|
onerror: (e) => {
|
|
166
175
|
console.warn("SSE connection error, reconnecting...", e);
|
|
167
176
|
let t = new CustomEvent("error", { detail: e });
|
|
168
|
-
return this.onerror?.bind(this)(t), 3e4 + Math.floor(Math.random() *
|
|
177
|
+
return this.onerror?.bind(this)(t), 3e4 + Math.floor(Math.random() * _);
|
|
169
178
|
}
|
|
170
179
|
});
|
|
171
180
|
}
|
|
@@ -194,8 +203,8 @@ var d = /* @__PURE__ */ function(e) {
|
|
|
194
203
|
updateLanguage(e) {
|
|
195
204
|
this.fetchOptions.headers["Accept-Language"] = e, this.close(), this.connect();
|
|
196
205
|
}
|
|
197
|
-
},
|
|
198
|
-
|
|
206
|
+
}, y = null, b = (e, t) => (y ||= new v(new URL("ocs/v2.php/apps/notifications/api/v1/notifications/sse", e).href, t), y), x = () => {
|
|
207
|
+
y &&= (y.close(), null);
|
|
199
208
|
};
|
|
200
209
|
//#endregion
|
|
201
|
-
export {
|
|
210
|
+
export { h as MESSAGE_TYPE, g as RetriableError, v as SSEAdapter, x as resetSSE, b as sse, m as sseEventSchema };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as e } from "../webdav-
|
|
2
|
-
import { G as t, K as n, U as r, W as i, q as a } from "../helpers-
|
|
1
|
+
import { t as e } from "../webdav-BdeuuZHv.js";
|
|
2
|
+
import { G as t, K as n, U as r, W as i, q as a } from "../helpers-CrYtf7Ol.js";
|
|
3
3
|
export { r as DavMethod, i as DavNamespaces, t as DavPermission, n as DavProperties, a as DavProperty, e as webdav };
|
package/dist/web-client.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as e } from "./graph-
|
|
2
|
-
import { i as t, n, r, t as i } from "./webdav-
|
|
1
|
+
import { t as e } from "./graph-u53S3WT9.js";
|
|
2
|
+
import { i as t, n, r, t as i } from "./webdav-BdeuuZHv.js";
|
|
3
3
|
import { t as a } from "./urlJoin-_pUL1TUx.js";
|
|
4
|
-
import { A as o, B as s, C as c, D as l, E as u, F as d, H as f, I as p, J as m, L as h, M as g, N as _, O as v, P as y, R as b, S as x, T as S, V as C, Y as w, _ as T, a as E, b as D, c as O, d as k, f as A, g as j, h as M, i as N, j as P, k as F, l as I, m as L, n as R, o as z, p as B, r as V, s as H, t as U, u as W, v as G, w as K, x as q, y as J, z as Y } from "./helpers-
|
|
5
|
-
import { t as X } from "./ocs-
|
|
6
|
-
import {
|
|
4
|
+
import { A as o, B as s, C as c, D as l, E as u, F as d, H as f, I as p, J as m, L as h, M as g, N as _, O as v, P as y, R as b, S as x, T as S, V as C, Y as w, _ as T, a as E, b as D, c as O, d as k, f as A, g as j, h as M, i as N, j as P, k as F, l as I, m as L, n as R, o as z, p as B, r as V, s as H, t as U, u as W, v as G, w as K, x as q, y as J, z as Y } from "./helpers-CrYtf7Ol.js";
|
|
5
|
+
import { t as X } from "./ocs-CDSkdguM.js";
|
|
6
|
+
import { ox as Z } from "./web-client/ox.js";
|
|
7
7
|
//#region src/helpers/call.ts
|
|
8
8
|
var Q = function* (e) {
|
|
9
9
|
return yield e;
|