@opencloud-eu/web-client 3.2.0 → 4.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/functions-CKtvRiMa.cjs +1 -0
- package/dist/functions-aGu-ugzD.js +1188 -0
- package/dist/index-BIL0cW_q.js +1755 -0
- package/dist/index-Bc1xE_gW.cjs +16 -0
- package/dist/index-BtN57j2H.cjs +1 -0
- package/dist/index-DAa_DzDf.cjs +6 -0
- package/dist/index-DRZfsp9q.js +686 -0
- package/dist/{index-DxUgq3ag.js → index-DZvghmpY.js} +1937 -1953
- package/dist/{index-C6VnMvgz.cjs → index-D_NPkUGY.cjs} +1 -1
- package/dist/{index-Pl8khka8.js → index-JHVTaNRI.js} +2 -2
- package/dist/src/graph/driveItems/types.d.ts +6 -2
- package/dist/src/graph/drives/types.d.ts +0 -3
- package/dist/src/graph/generated/api.d.ts +120 -98
- package/dist/src/helpers/resource/types.d.ts +1 -1
- package/dist/src/helpers/share/constants.d.ts +0 -1
- package/dist/src/helpers/share/types.d.ts +1 -1
- package/dist/src/helpers/space/functions.d.ts +2 -1
- package/dist/src/ocs/capabilities.d.ts +2 -0
- package/dist/src/webdav/constants/dav.d.ts +1 -0
- package/dist/src/webdav/types.d.ts +1 -1
- package/dist/toString-CgHWCW2N.cjs +1 -0
- package/dist/{toString-Cn0xCZ28.js → toString-XlfBosfh.js} +4 -4
- package/dist/web-client/graph/generated.cjs +1 -1
- package/dist/web-client/graph/generated.js +1984 -2066
- package/dist/web-client/graph.cjs +1 -1
- package/dist/web-client/graph.js +1 -1
- package/dist/web-client/ocs.cjs +12 -12
- package/dist/web-client/ocs.js +1889 -1857
- package/dist/web-client/sse.cjs +2 -2
- package/dist/web-client/sse.js +95 -105
- package/dist/web-client/webdav.cjs +1 -1
- package/dist/web-client/webdav.js +3 -3
- package/dist/web-client.cjs +1 -1
- package/dist/web-client.js +83 -82
- package/package.json +2 -2
- package/dist/functions-CYOnwClV.js +0 -1178
- package/dist/functions-DEaUzlbB.cjs +0 -1
- package/dist/index-B3tdq56F.cjs +0 -16
- package/dist/index-BTGj2rHD.js +0 -1705
- package/dist/index-C-U4KVPG.cjs +0 -6
- package/dist/index-D3QfKFAH.cjs +0 -1
- package/dist/index-oCdLZPEA.js +0 -699
- package/dist/toString-hHr716Th.cjs +0 -1
|
@@ -0,0 +1,686 @@
|
|
|
1
|
+
import { UserApiFactory as N, UsersApiFactory as E, MeUserApiFactory as x, MeChangepasswordApiFactory as L, UserAppRoleAssignmentApiFactory as O, GroupApiFactory as z, GroupsApiFactory as W, ApplicationsApiFactory as V, DrivesApiFactory as j, MeDrivesApi as H, DrivesGetDrivesApi as Y, DriveItemApiFactory as _, DrivesRootApiFactory as R, MeDriveApiFactory as J, TagsApiFactory as Q, ActivitiesApiFactory as Z, RoleManagementApiFactory as $, DrivesPermissionsApiFactory as K, MePhotoApiFactory as X, UserPhotoApiFactory as q, Configuration as C } from "./web-client/graph/generated.js";
|
|
2
|
+
import { u as v, g as I, r as ee } from "./toString-XlfBosfh.js";
|
|
3
|
+
import { E as ae, F as te, H as re, d as T, n as h, o as U, h as k, e as B, G as g, v as A } from "./functions-aGu-ugzD.js";
|
|
4
|
+
const se = ({ axiosClient: e, config: s }) => {
|
|
5
|
+
const o = N(s, s.basePath, e), c = E(s, s.basePath, e), i = x(s, s.basePath, e), a = L(
|
|
6
|
+
s,
|
|
7
|
+
s.basePath,
|
|
8
|
+
e
|
|
9
|
+
), t = O(
|
|
10
|
+
s,
|
|
11
|
+
s.basePath,
|
|
12
|
+
e
|
|
13
|
+
);
|
|
14
|
+
return {
|
|
15
|
+
async getUser(r, n, u) {
|
|
16
|
+
const { data: l } = await o.getUser(
|
|
17
|
+
r,
|
|
18
|
+
n?.select ? /* @__PURE__ */ new Set([...n.select]) : null,
|
|
19
|
+
n?.expand ? /* @__PURE__ */ new Set([...n.expand]) : /* @__PURE__ */ new Set(["drive", "memberOf", "appRoleAssignments"]),
|
|
20
|
+
u
|
|
21
|
+
);
|
|
22
|
+
return l;
|
|
23
|
+
},
|
|
24
|
+
async createUser(r, n) {
|
|
25
|
+
const { data: u } = await c.createUser(r, n);
|
|
26
|
+
return u;
|
|
27
|
+
},
|
|
28
|
+
async editUser(r, n, u) {
|
|
29
|
+
const { data: l } = await o.updateUser(r, n, u);
|
|
30
|
+
return l;
|
|
31
|
+
},
|
|
32
|
+
async deleteUser(r, n, u) {
|
|
33
|
+
await o.deleteUser(r, n, u);
|
|
34
|
+
},
|
|
35
|
+
async listUsers(r, n) {
|
|
36
|
+
const {
|
|
37
|
+
data: { value: u }
|
|
38
|
+
} = await c.listUsers(
|
|
39
|
+
r?.search,
|
|
40
|
+
r?.filter,
|
|
41
|
+
r?.orderBy ? /* @__PURE__ */ new Set([...r.orderBy]) : null,
|
|
42
|
+
r?.select ? /* @__PURE__ */ new Set([...r.select]) : null,
|
|
43
|
+
r?.expand ? /* @__PURE__ */ new Set([...r.expand]) : null,
|
|
44
|
+
n
|
|
45
|
+
);
|
|
46
|
+
return u;
|
|
47
|
+
},
|
|
48
|
+
async getMe(r, n) {
|
|
49
|
+
const { data: u } = await i.getOwnUser(
|
|
50
|
+
r?.expand ? /* @__PURE__ */ new Set([...r.expand]) : /* @__PURE__ */ new Set(["memberOf"]),
|
|
51
|
+
n
|
|
52
|
+
);
|
|
53
|
+
return u;
|
|
54
|
+
},
|
|
55
|
+
async editMe(r, n) {
|
|
56
|
+
const { data: u } = await i.updateOwnUser(r, n);
|
|
57
|
+
return u;
|
|
58
|
+
},
|
|
59
|
+
async changeOwnPassword(r, n) {
|
|
60
|
+
await a.changeOwnPassword(r, n);
|
|
61
|
+
},
|
|
62
|
+
async exportPersonalData(r, n, u) {
|
|
63
|
+
await o.exportPersonalData(r, n, u);
|
|
64
|
+
},
|
|
65
|
+
async createUserAppRoleAssignment(r, n, u) {
|
|
66
|
+
const { data: l } = await t.userCreateAppRoleAssignments(
|
|
67
|
+
r,
|
|
68
|
+
n,
|
|
69
|
+
u
|
|
70
|
+
);
|
|
71
|
+
return l;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}, ne = ({ axiosClient: e, config: s }) => {
|
|
75
|
+
const o = z(s, s.basePath, e), c = W(s, s.basePath, e);
|
|
76
|
+
return {
|
|
77
|
+
async getGroup(i, a, t) {
|
|
78
|
+
const { data: r } = await o.getGroup(
|
|
79
|
+
i,
|
|
80
|
+
a?.select ? /* @__PURE__ */ new Set([...a.select]) : null,
|
|
81
|
+
a?.expand ? /* @__PURE__ */ new Set([...a.expand]) : /* @__PURE__ */ new Set(["members"]),
|
|
82
|
+
t
|
|
83
|
+
);
|
|
84
|
+
return r;
|
|
85
|
+
},
|
|
86
|
+
async createGroup(i, a) {
|
|
87
|
+
const { data: t } = await c.createGroup(i, a);
|
|
88
|
+
return t;
|
|
89
|
+
},
|
|
90
|
+
async editGroup(i, a, t) {
|
|
91
|
+
const { data: r } = await o.updateGroup(i, a, t);
|
|
92
|
+
return r;
|
|
93
|
+
},
|
|
94
|
+
async deleteGroup(i, a, t) {
|
|
95
|
+
await o.deleteGroup(i, a, t);
|
|
96
|
+
},
|
|
97
|
+
async listGroups(i, a) {
|
|
98
|
+
const {
|
|
99
|
+
data: { value: t }
|
|
100
|
+
} = await c.listGroups(
|
|
101
|
+
i?.search,
|
|
102
|
+
i?.orderBy ? /* @__PURE__ */ new Set([...i.orderBy]) : null,
|
|
103
|
+
i?.select ? /* @__PURE__ */ new Set([...i.select]) : null,
|
|
104
|
+
i?.expand ? /* @__PURE__ */ new Set([...i.expand]) : null,
|
|
105
|
+
a
|
|
106
|
+
);
|
|
107
|
+
return t;
|
|
108
|
+
},
|
|
109
|
+
async addMember(i, a, t) {
|
|
110
|
+
await o.addMember(
|
|
111
|
+
i,
|
|
112
|
+
{ "@odata.id": v(s.basePath, "v1.0", "users", a) },
|
|
113
|
+
t
|
|
114
|
+
);
|
|
115
|
+
},
|
|
116
|
+
async deleteMember(i, a, t, r) {
|
|
117
|
+
await o.deleteMember(i, a, t, r);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}, ie = ({
|
|
121
|
+
axiosClient: e,
|
|
122
|
+
config: s
|
|
123
|
+
}) => {
|
|
124
|
+
const o = V(s, s.basePath, e);
|
|
125
|
+
return {
|
|
126
|
+
async getApplication(c, i) {
|
|
127
|
+
const { data: a } = await o.getApplication(c, i);
|
|
128
|
+
return a;
|
|
129
|
+
},
|
|
130
|
+
async listApplications(c) {
|
|
131
|
+
const {
|
|
132
|
+
data: { value: i }
|
|
133
|
+
} = await o.listApplications(c);
|
|
134
|
+
return i || [];
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
function oe() {
|
|
139
|
+
}
|
|
140
|
+
var F = I(ee, "Set");
|
|
141
|
+
function M(e) {
|
|
142
|
+
var s = -1, o = Array(e.size);
|
|
143
|
+
return e.forEach(function(c) {
|
|
144
|
+
o[++s] = c;
|
|
145
|
+
}), o;
|
|
146
|
+
}
|
|
147
|
+
var ce = 1 / 0, le = F && 1 / M(new F([, -0]))[1] == ce ? function(e) {
|
|
148
|
+
return new F(e);
|
|
149
|
+
} : oe, ue = 200;
|
|
150
|
+
function de(e, s, o) {
|
|
151
|
+
var c = -1, i = te, a = e.length, t = !0, r = [], n = r;
|
|
152
|
+
if (a >= ue) {
|
|
153
|
+
var u = le(e);
|
|
154
|
+
if (u)
|
|
155
|
+
return M(u);
|
|
156
|
+
t = !1, i = re, n = new ae();
|
|
157
|
+
} else
|
|
158
|
+
n = r;
|
|
159
|
+
e:
|
|
160
|
+
for (; ++c < a; ) {
|
|
161
|
+
var l = e[c], d = l;
|
|
162
|
+
if (l = l !== 0 ? l : 0, t && d === d) {
|
|
163
|
+
for (var p = n.length; p--; )
|
|
164
|
+
if (n[p] === d)
|
|
165
|
+
continue e;
|
|
166
|
+
r.push(l);
|
|
167
|
+
} else i(n, d, o) || (n !== r && n.push(d), r.push(l));
|
|
168
|
+
}
|
|
169
|
+
return r;
|
|
170
|
+
}
|
|
171
|
+
function pe(e) {
|
|
172
|
+
return e && e.length ? de(e) : [];
|
|
173
|
+
}
|
|
174
|
+
const G = (e) => Object.hasOwn(e, "sharedWith"), Fe = (e) => G(e) && e.outgoing, fe = (e) => G(e) && !e.outgoing, Re = (e) => Object.hasOwn(e, "role"), Te = (e) => !Object.hasOwn(e, "role"), ye = ({
|
|
175
|
+
driveItem: e,
|
|
176
|
+
graphRoles: s
|
|
177
|
+
}) => e.remoteItem?.permissions.reduce((o, c) => (c.roles?.forEach((i) => {
|
|
178
|
+
const a = s[i];
|
|
179
|
+
a && !o.some(({ id: t }) => t === a.id) && o.push(a);
|
|
180
|
+
}), o), []), he = ({
|
|
181
|
+
driveItem: e,
|
|
182
|
+
shareRoles: s
|
|
183
|
+
}) => {
|
|
184
|
+
if (!s.length) {
|
|
185
|
+
const c = e.remoteItem?.permissions.reduce(
|
|
186
|
+
(i, a) => {
|
|
187
|
+
const t = a["@libre.graph.permissions.actions"];
|
|
188
|
+
return t && i.push(...t), i;
|
|
189
|
+
},
|
|
190
|
+
[]
|
|
191
|
+
);
|
|
192
|
+
return [...new Set(c)];
|
|
193
|
+
}
|
|
194
|
+
const o = s.reduce((c, i) => (i.rolePermissions.forEach((a) => {
|
|
195
|
+
c.push(...a.allowedResourceActions);
|
|
196
|
+
}), c), []);
|
|
197
|
+
return [...new Set(o)];
|
|
198
|
+
};
|
|
199
|
+
function Ue({
|
|
200
|
+
driveItem: e,
|
|
201
|
+
graphRoles: s,
|
|
202
|
+
serverUrl: o
|
|
203
|
+
}) {
|
|
204
|
+
const c = e.name || e.remoteItem.name, i = T(e.remoteItem.id), a = e.remoteItem.permissions.map((p) => {
|
|
205
|
+
const { grantedToV2: w } = p;
|
|
206
|
+
return {
|
|
207
|
+
...w.group || w.user,
|
|
208
|
+
shareType: b(p)
|
|
209
|
+
};
|
|
210
|
+
}), t = e.remoteItem.permissions.reduce((p, w) => {
|
|
211
|
+
const m = w.invitation.invitedBy.user;
|
|
212
|
+
return p.some(({ id: f }) => f === m.id) || p.push(m), p;
|
|
213
|
+
}, []);
|
|
214
|
+
let r = pe(e.remoteItem.permissions.map(b));
|
|
215
|
+
t.some((p) => p["@libre.graph.userType"] === "Federated") && (r = [h.remote.value]);
|
|
216
|
+
const u = ye({ driveItem: e, graphRoles: s }), l = he({ driveItem: e, shareRoles: u }), d = {
|
|
217
|
+
id: e.id,
|
|
218
|
+
remoteItemId: e.remoteItem.id,
|
|
219
|
+
driveId: e.parentReference?.driveId,
|
|
220
|
+
path: "/",
|
|
221
|
+
name: c,
|
|
222
|
+
fileId: e.remoteItem.id,
|
|
223
|
+
size: e.size,
|
|
224
|
+
storageId: i,
|
|
225
|
+
parentFolderId: e.parentReference?.id,
|
|
226
|
+
sdate: e.remoteItem.permissions[0].createdDateTime,
|
|
227
|
+
tags: [],
|
|
228
|
+
webDavPath: U(e.remoteItem.id, "/"),
|
|
229
|
+
sharedBy: t,
|
|
230
|
+
owner: e.remoteItem.createdBy?.user,
|
|
231
|
+
sharedWith: a,
|
|
232
|
+
shareTypes: r,
|
|
233
|
+
isFolder: !!e.folder,
|
|
234
|
+
type: e.folder ? "folder" : "file",
|
|
235
|
+
mimeType: e.file?.mimeType || "httpd/unix-directory",
|
|
236
|
+
mdate: e.lastModifiedDateTime ? new Date(e.lastModifiedDateTime).toUTCString() : void 0,
|
|
237
|
+
syncEnabled: e["@client.synchronize"],
|
|
238
|
+
hidden: e["@UI.Hidden"],
|
|
239
|
+
shareRoles: u,
|
|
240
|
+
sharePermissions: l,
|
|
241
|
+
outgoing: !1,
|
|
242
|
+
privateLink: v(o, "f", e.remoteItem.id),
|
|
243
|
+
hasPreview: () => !!e.thumbnails,
|
|
244
|
+
canRename: () => e["@client.synchronize"],
|
|
245
|
+
canDownload: () => l.includes(g.readContent),
|
|
246
|
+
canUpload: () => l.includes(g.createUpload),
|
|
247
|
+
canCreate: () => l.includes(g.createChildren),
|
|
248
|
+
canBeDeleted: () => l.includes(g.deleteStandard),
|
|
249
|
+
canEditTags: () => l.includes(g.createChildren),
|
|
250
|
+
isMounted: () => !1,
|
|
251
|
+
isReceivedShare: () => !0,
|
|
252
|
+
canShare: () => !1,
|
|
253
|
+
getDomSelector: () => B(e.id)
|
|
254
|
+
};
|
|
255
|
+
return d.extension = k(d), d;
|
|
256
|
+
}
|
|
257
|
+
function ke({
|
|
258
|
+
driveItem: e,
|
|
259
|
+
user: s,
|
|
260
|
+
serverUrl: o
|
|
261
|
+
}) {
|
|
262
|
+
const c = T(e.id), i = v(e.parentReference.path, e.name), a = {
|
|
263
|
+
id: e.id,
|
|
264
|
+
driveId: e.parentReference?.driveId,
|
|
265
|
+
path: i,
|
|
266
|
+
name: e.name,
|
|
267
|
+
fileId: e.id,
|
|
268
|
+
size: e.size,
|
|
269
|
+
storageId: c,
|
|
270
|
+
parentFolderId: e.parentReference?.id,
|
|
271
|
+
sdate: e.permissions[0].createdDateTime,
|
|
272
|
+
tags: [],
|
|
273
|
+
webDavPath: U(c, i),
|
|
274
|
+
sharedBy: [{ id: s.id, displayName: s.displayName }],
|
|
275
|
+
owner: { id: s.id, displayName: s.displayName },
|
|
276
|
+
sharedWith: e.permissions.map((t) => {
|
|
277
|
+
if (t.link)
|
|
278
|
+
return {
|
|
279
|
+
id: t.id,
|
|
280
|
+
displayName: t.link["@libre.graph.displayName"],
|
|
281
|
+
shareType: h.link.value
|
|
282
|
+
};
|
|
283
|
+
const r = b(t);
|
|
284
|
+
return { ...t.grantedToV2.user || t.grantedToV2.group, shareType: r };
|
|
285
|
+
}),
|
|
286
|
+
shareTypes: e.permissions.map(b),
|
|
287
|
+
isFolder: !!e.folder,
|
|
288
|
+
type: e.folder ? "folder" : "file",
|
|
289
|
+
mimeType: e.file?.mimeType || "httpd/unix-directory",
|
|
290
|
+
outgoing: !0,
|
|
291
|
+
privateLink: v(o, "f", e.id),
|
|
292
|
+
hasPreview: () => !!e.thumbnails,
|
|
293
|
+
canRename: () => !0,
|
|
294
|
+
canDownload: () => !0,
|
|
295
|
+
canUpload: () => !0,
|
|
296
|
+
canCreate: () => !0,
|
|
297
|
+
canBeDeleted: () => !0,
|
|
298
|
+
canEditTags: () => !0,
|
|
299
|
+
isMounted: () => !1,
|
|
300
|
+
isReceivedShare: () => !0,
|
|
301
|
+
canShare: () => !0,
|
|
302
|
+
getDomSelector: () => B(e.id)
|
|
303
|
+
};
|
|
304
|
+
return a.extension = k(a), a;
|
|
305
|
+
}
|
|
306
|
+
function S({
|
|
307
|
+
graphPermission: e,
|
|
308
|
+
graphRoles: s,
|
|
309
|
+
resourceId: o,
|
|
310
|
+
indirect: c = !1
|
|
311
|
+
}) {
|
|
312
|
+
const i = s[e.roles?.[0]], a = e.invitation?.invitedBy?.user;
|
|
313
|
+
return {
|
|
314
|
+
id: e.id,
|
|
315
|
+
resourceId: o,
|
|
316
|
+
indirect: c,
|
|
317
|
+
shareType: b(e),
|
|
318
|
+
role: i,
|
|
319
|
+
sharedBy: { id: a?.id, displayName: a?.displayName },
|
|
320
|
+
sharedWith: e.grantedToV2.user || e.grantedToV2.group,
|
|
321
|
+
permissions: e["@libre.graph.permissions.actions"] ? e["@libre.graph.permissions.actions"] : i.rolePermissions.flatMap((t) => t.allowedResourceActions),
|
|
322
|
+
createdDateTime: e.createdDateTime,
|
|
323
|
+
expirationDateTime: e.expirationDateTime
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
function P({
|
|
327
|
+
graphPermission: e,
|
|
328
|
+
resourceId: s,
|
|
329
|
+
indirect: o = !1
|
|
330
|
+
}) {
|
|
331
|
+
const c = e.invitation?.invitedBy?.user;
|
|
332
|
+
return {
|
|
333
|
+
id: e.id,
|
|
334
|
+
resourceId: s,
|
|
335
|
+
indirect: o,
|
|
336
|
+
shareType: h.link.value,
|
|
337
|
+
sharedBy: { id: c?.id, displayName: c?.displayName },
|
|
338
|
+
hasPassword: e.hasPassword,
|
|
339
|
+
createdDateTime: e.createdDateTime,
|
|
340
|
+
expirationDateTime: e.expirationDateTime,
|
|
341
|
+
displayName: e.link["@libre.graph.displayName"],
|
|
342
|
+
isQuickLink: e.link["@libre.graph.quickLink"],
|
|
343
|
+
type: e.link.type,
|
|
344
|
+
webUrl: e.link.webUrl,
|
|
345
|
+
preventsDownload: e.link.preventsDownload
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
function b({ link: e, grantedToV2: s }) {
|
|
349
|
+
return e ? h.link.value : s?.group ? h.group.value : s?.user?.["@libre.graph.userType"] === "Federated" ? h.remote.value : h.user.value;
|
|
350
|
+
}
|
|
351
|
+
const D = (e) => new URL(e.webUrl).origin, we = ({ axiosClient: e, config: s }) => {
|
|
352
|
+
const o = j(s, s.basePath, e), c = new H(s, s.basePath, e), i = new Y(s, s.basePath, e);
|
|
353
|
+
return {
|
|
354
|
+
async getDrive(a, t, r) {
|
|
355
|
+
const { data: n } = await o.getDrive(
|
|
356
|
+
a,
|
|
357
|
+
t?.select ? /* @__PURE__ */ new Set([...t.select]) : null,
|
|
358
|
+
r
|
|
359
|
+
);
|
|
360
|
+
return A({ ...n, serverUrl: D(n) });
|
|
361
|
+
},
|
|
362
|
+
async createDrive(a, t) {
|
|
363
|
+
const { data: r } = await o.createDrive(a, t);
|
|
364
|
+
return A({ ...r, serverUrl: D(r) });
|
|
365
|
+
},
|
|
366
|
+
async updateDrive(a, t, r) {
|
|
367
|
+
const { data: n } = await o.updateDrive(a, t, r);
|
|
368
|
+
return A({ ...n, serverUrl: D(n) });
|
|
369
|
+
},
|
|
370
|
+
async disableDrive(a, t, r) {
|
|
371
|
+
await o.deleteDrive(a, t, r);
|
|
372
|
+
},
|
|
373
|
+
async deleteDrive(a, t, r) {
|
|
374
|
+
await o.deleteDrive(a, t, {
|
|
375
|
+
headers: {
|
|
376
|
+
...r?.headers && r.headers || {},
|
|
377
|
+
Purge: "T"
|
|
378
|
+
},
|
|
379
|
+
...r && { requestOptions: r } || {}
|
|
380
|
+
});
|
|
381
|
+
},
|
|
382
|
+
async listMyDrives(a, t) {
|
|
383
|
+
const {
|
|
384
|
+
data: { value: r }
|
|
385
|
+
} = await c.listMyDrivesBeta(
|
|
386
|
+
a?.orderBy,
|
|
387
|
+
a?.filter,
|
|
388
|
+
a?.expand,
|
|
389
|
+
a?.select ? /* @__PURE__ */ new Set([...a.select]) : null,
|
|
390
|
+
t
|
|
391
|
+
);
|
|
392
|
+
return r.map((n) => A({ ...n, serverUrl: D(n) }));
|
|
393
|
+
},
|
|
394
|
+
async listAllDrives(a, t) {
|
|
395
|
+
const {
|
|
396
|
+
data: { value: r }
|
|
397
|
+
} = await i.listAllDrivesBeta(
|
|
398
|
+
a?.orderBy,
|
|
399
|
+
a?.filter,
|
|
400
|
+
a?.expand,
|
|
401
|
+
a?.select ? /* @__PURE__ */ new Set([...a.select]) : null,
|
|
402
|
+
t
|
|
403
|
+
);
|
|
404
|
+
return r.map((n) => A({ ...n, serverUrl: D(n) }));
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
}, me = ({
|
|
408
|
+
axiosClient: e,
|
|
409
|
+
config: s
|
|
410
|
+
}) => {
|
|
411
|
+
const o = _(s, s.basePath, e), c = R(s, s.basePath, e), i = J(s, s.basePath, e);
|
|
412
|
+
return {
|
|
413
|
+
async getDriveItem(a, t, r) {
|
|
414
|
+
const { data: n } = await o.getDriveItem(a, t, r);
|
|
415
|
+
return n;
|
|
416
|
+
},
|
|
417
|
+
async createDriveItem(a, t, r) {
|
|
418
|
+
const { data: n } = await c.createDriveItem(
|
|
419
|
+
a,
|
|
420
|
+
t,
|
|
421
|
+
r
|
|
422
|
+
);
|
|
423
|
+
return n;
|
|
424
|
+
},
|
|
425
|
+
async updateDriveItem(a, t, r, n) {
|
|
426
|
+
const { data: u } = await o.updateDriveItem(
|
|
427
|
+
a,
|
|
428
|
+
t,
|
|
429
|
+
r,
|
|
430
|
+
n
|
|
431
|
+
);
|
|
432
|
+
return u;
|
|
433
|
+
},
|
|
434
|
+
async deleteDriveItem(a, t, r) {
|
|
435
|
+
await o.deleteDriveItem(a, t, r);
|
|
436
|
+
},
|
|
437
|
+
async listSharedByMe(a, t) {
|
|
438
|
+
const { data: r } = await i.listSharedByMe(a?.expand, t);
|
|
439
|
+
return r?.value || [];
|
|
440
|
+
},
|
|
441
|
+
async listSharedWithMe(a, t) {
|
|
442
|
+
const { data: r } = await i.listSharedWithMe(a?.expand, t);
|
|
443
|
+
return r?.value || [];
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
}, ge = ({ axiosClient: e, config: s }) => {
|
|
447
|
+
const o = Q(s, s.basePath, e);
|
|
448
|
+
return {
|
|
449
|
+
async listTags(c) {
|
|
450
|
+
const {
|
|
451
|
+
data: { value: i }
|
|
452
|
+
} = await o.getTags(c);
|
|
453
|
+
return i || [];
|
|
454
|
+
},
|
|
455
|
+
async assignTags(c, i) {
|
|
456
|
+
await o.assignTags(c, i);
|
|
457
|
+
},
|
|
458
|
+
async unassignTags(c, i) {
|
|
459
|
+
await o.unassignTags(c, i);
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
}, Ae = ({
|
|
463
|
+
axiosClient: e,
|
|
464
|
+
config: s
|
|
465
|
+
}) => {
|
|
466
|
+
const o = Z(s, s.basePath, e);
|
|
467
|
+
return {
|
|
468
|
+
async listActivities(c, i) {
|
|
469
|
+
const {
|
|
470
|
+
data: { value: a }
|
|
471
|
+
} = await o.getActivities(c, i);
|
|
472
|
+
return a || [];
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
}, Pe = ({
|
|
476
|
+
axiosClient: e,
|
|
477
|
+
config: s
|
|
478
|
+
}) => {
|
|
479
|
+
const o = R(s, s.basePath, e), c = $(s, s.basePath, e), i = K(
|
|
480
|
+
s,
|
|
481
|
+
s.basePath,
|
|
482
|
+
e
|
|
483
|
+
);
|
|
484
|
+
return {
|
|
485
|
+
async getPermission(a, t, r, n, u) {
|
|
486
|
+
const { data: l } = await i.getPermission(
|
|
487
|
+
a,
|
|
488
|
+
t,
|
|
489
|
+
r,
|
|
490
|
+
u
|
|
491
|
+
);
|
|
492
|
+
return l.link ? P({ graphPermission: l, resourceId: t }) : S({
|
|
493
|
+
graphPermission: l,
|
|
494
|
+
resourceId: t,
|
|
495
|
+
graphRoles: n || {}
|
|
496
|
+
});
|
|
497
|
+
},
|
|
498
|
+
async listPermissions(a, t, r, n, u) {
|
|
499
|
+
let l;
|
|
500
|
+
if (a === t) {
|
|
501
|
+
const { data: y } = await o.listPermissionsSpaceRoot(
|
|
502
|
+
a,
|
|
503
|
+
n?.filter,
|
|
504
|
+
n?.select ? /* @__PURE__ */ new Set([...n.select]) : null,
|
|
505
|
+
n?.count,
|
|
506
|
+
n?.top || 0,
|
|
507
|
+
u
|
|
508
|
+
);
|
|
509
|
+
l = y;
|
|
510
|
+
} else {
|
|
511
|
+
const { data: y } = await i.listPermissions(
|
|
512
|
+
a,
|
|
513
|
+
t,
|
|
514
|
+
n?.filter,
|
|
515
|
+
n?.select ? /* @__PURE__ */ new Set([...n.select]) : null,
|
|
516
|
+
n?.count,
|
|
517
|
+
n?.top || 0,
|
|
518
|
+
u
|
|
519
|
+
);
|
|
520
|
+
l = y;
|
|
521
|
+
}
|
|
522
|
+
const d = l.value || [], p = l["@libre.graph.permissions.actions.allowedValues"], w = l["@libre.graph.permissions.roles.allowedValues"], m = l["@odata.count"];
|
|
523
|
+
return { shares: d.map((y) => y.link ? P({ graphPermission: y, resourceId: t }) : S({
|
|
524
|
+
graphPermission: y,
|
|
525
|
+
resourceId: t,
|
|
526
|
+
graphRoles: r || {}
|
|
527
|
+
})), allowedActions: p, allowedRoles: w, count: m };
|
|
528
|
+
},
|
|
529
|
+
async updatePermission(a, t, r, n, u, l) {
|
|
530
|
+
let d;
|
|
531
|
+
if (a === t) {
|
|
532
|
+
const { data: p } = await o.updatePermissionSpaceRoot(
|
|
533
|
+
a,
|
|
534
|
+
r,
|
|
535
|
+
n,
|
|
536
|
+
l
|
|
537
|
+
);
|
|
538
|
+
d = p;
|
|
539
|
+
} else {
|
|
540
|
+
const { data: p } = await i.updatePermission(
|
|
541
|
+
a,
|
|
542
|
+
t,
|
|
543
|
+
r,
|
|
544
|
+
n,
|
|
545
|
+
l
|
|
546
|
+
);
|
|
547
|
+
d = p;
|
|
548
|
+
}
|
|
549
|
+
return d.link ? P({ graphPermission: d, resourceId: t }) : S({
|
|
550
|
+
graphPermission: d,
|
|
551
|
+
resourceId: t,
|
|
552
|
+
graphRoles: u || {}
|
|
553
|
+
});
|
|
554
|
+
},
|
|
555
|
+
async deletePermission(a, t, r, n) {
|
|
556
|
+
if (a === t) {
|
|
557
|
+
await o.deletePermissionSpaceRoot(a, r, n);
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
await i.deletePermission(a, t, r, n);
|
|
561
|
+
},
|
|
562
|
+
async createInvite(a, t, r, n, u) {
|
|
563
|
+
let l;
|
|
564
|
+
if (a === t) {
|
|
565
|
+
const { data: d } = await o.inviteSpaceRoot(
|
|
566
|
+
a,
|
|
567
|
+
r,
|
|
568
|
+
u
|
|
569
|
+
);
|
|
570
|
+
l = d.value?.[0];
|
|
571
|
+
} else {
|
|
572
|
+
const { data: d } = await i.invite(
|
|
573
|
+
a,
|
|
574
|
+
t,
|
|
575
|
+
r,
|
|
576
|
+
u
|
|
577
|
+
);
|
|
578
|
+
l = d.value?.[0];
|
|
579
|
+
}
|
|
580
|
+
if (!l)
|
|
581
|
+
throw new Error("no permission returned");
|
|
582
|
+
return S({
|
|
583
|
+
graphPermission: l,
|
|
584
|
+
resourceId: t,
|
|
585
|
+
graphRoles: n || {}
|
|
586
|
+
});
|
|
587
|
+
},
|
|
588
|
+
async createLink(a, t, r, n) {
|
|
589
|
+
let u;
|
|
590
|
+
if (a === t) {
|
|
591
|
+
const { data: l } = await o.createLinkSpaceRoot(
|
|
592
|
+
a,
|
|
593
|
+
r,
|
|
594
|
+
n
|
|
595
|
+
);
|
|
596
|
+
u = l;
|
|
597
|
+
} else {
|
|
598
|
+
const { data: l } = await i.createLink(
|
|
599
|
+
a,
|
|
600
|
+
t,
|
|
601
|
+
r,
|
|
602
|
+
n
|
|
603
|
+
);
|
|
604
|
+
u = l;
|
|
605
|
+
}
|
|
606
|
+
return P({ graphPermission: u, resourceId: t });
|
|
607
|
+
},
|
|
608
|
+
async setPermissionPassword(a, t, r, n, u) {
|
|
609
|
+
let l;
|
|
610
|
+
if (a === t) {
|
|
611
|
+
const { data: d } = await o.setPermissionPasswordSpaceRoot(
|
|
612
|
+
a,
|
|
613
|
+
r,
|
|
614
|
+
n,
|
|
615
|
+
u
|
|
616
|
+
);
|
|
617
|
+
l = d;
|
|
618
|
+
} else {
|
|
619
|
+
const { data: d } = await i.setPermissionPassword(
|
|
620
|
+
a,
|
|
621
|
+
t,
|
|
622
|
+
r,
|
|
623
|
+
n,
|
|
624
|
+
u
|
|
625
|
+
);
|
|
626
|
+
l = d;
|
|
627
|
+
}
|
|
628
|
+
return P({ graphPermission: l, resourceId: t });
|
|
629
|
+
},
|
|
630
|
+
async listRoleDefinitions(a) {
|
|
631
|
+
const { data: t } = await c.listPermissionRoleDefinitions(a);
|
|
632
|
+
return t;
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
}, De = ({ axiosClient: e, config: s }) => {
|
|
636
|
+
const o = X(s, s.basePath, e), c = q(s, s.basePath, e);
|
|
637
|
+
return {
|
|
638
|
+
async getOwnUserPhoto(i) {
|
|
639
|
+
const { data: a } = await o.getOwnUserPhoto(i);
|
|
640
|
+
return a;
|
|
641
|
+
},
|
|
642
|
+
async deleteOwnUserPhoto(i) {
|
|
643
|
+
const { data: a } = await o.deleteOwnUserPhoto(i);
|
|
644
|
+
return a;
|
|
645
|
+
},
|
|
646
|
+
async updateOwnUserPhotoPatch(i, a) {
|
|
647
|
+
const { data: t } = await o.updateOwnUserPhotoPatch(i, a);
|
|
648
|
+
return t;
|
|
649
|
+
},
|
|
650
|
+
async getUserPhoto(i, a) {
|
|
651
|
+
const { data: t } = await c.getUserPhoto(i, a);
|
|
652
|
+
return t;
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
}, Be = (e, s) => {
|
|
656
|
+
const o = new URL(e);
|
|
657
|
+
o.pathname = [...o.pathname.split("/"), "graph"].filter(Boolean).join("/");
|
|
658
|
+
const c = new C({
|
|
659
|
+
basePath: o.href
|
|
660
|
+
});
|
|
661
|
+
return {
|
|
662
|
+
activities: Ae({ axiosClient: s, config: c }),
|
|
663
|
+
applications: ie({ axiosClient: s, config: c }),
|
|
664
|
+
tags: ge({ axiosClient: s, config: c }),
|
|
665
|
+
drives: we({ axiosClient: s, config: c }),
|
|
666
|
+
driveItems: me({ axiosClient: s, config: c }),
|
|
667
|
+
users: se({ axiosClient: s, config: c }),
|
|
668
|
+
groups: ne({ axiosClient: s, config: c }),
|
|
669
|
+
permissions: Pe({ axiosClient: s, config: c }),
|
|
670
|
+
photos: De({ axiosClient: s, config: c })
|
|
671
|
+
};
|
|
672
|
+
};
|
|
673
|
+
export {
|
|
674
|
+
Fe as a,
|
|
675
|
+
fe as b,
|
|
676
|
+
Re as c,
|
|
677
|
+
Te as d,
|
|
678
|
+
ye as e,
|
|
679
|
+
he as f,
|
|
680
|
+
Be as g,
|
|
681
|
+
Ue as h,
|
|
682
|
+
G as i,
|
|
683
|
+
ke as j,
|
|
684
|
+
S as k,
|
|
685
|
+
P as l
|
|
686
|
+
};
|