@opencloud-eu/web-client 2.4.0 → 3.2.0

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