@opencloud-eu/web-client 2.3.0 → 3.1.0

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