@opencloud-eu/web-client 7.4.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.
@@ -1,375 +0,0 @@
1
- import { Ht as e, Ln as t, M as n, Nn as r, O as i, Qt as a, Rt as o, S as s, Tn as c, _n as l, b as u, c as d, cn as f, fn as p, g as m, i as h, in as g, kn as _, mt as v, t as y, ut as b, xn as x } from "./generated-CSkivkhn.js";
2
- import { t as S } from "./urlJoin-_pUL1TUx.js";
3
- import { m as C, r as w, t as T } from "./helpers-hr58GB0t.js";
4
- //#region src/graph/users/users.ts
5
- var E = ({ axiosClient: e, config: n }) => {
6
- let i = x(n, n.basePath, e), a = t(n, n.basePath, e), s = f(n, n.basePath, e), l = o(n, n.basePath, e), u = c(n, n.basePath, e), d = r(n, n.basePath, e);
7
- return {
8
- async getUser(e, t, n) {
9
- let { data: r } = await i.getUser(e, t?.select ? /* @__PURE__ */ new Set([...t.select]) : null, t?.expand ? /* @__PURE__ */ new Set([...t.expand]) : /* @__PURE__ */ new Set([
10
- "drive",
11
- "memberOf",
12
- "appRoleAssignments"
13
- ]), n);
14
- return r;
15
- },
16
- async createUser(e, t) {
17
- let { data: n } = await a.createUser(e, t);
18
- return n;
19
- },
20
- async editUser(e, t, n) {
21
- let { data: r } = await i.updateUser(e, t, n);
22
- return r;
23
- },
24
- async deleteUser(e, t, n) {
25
- await i.deleteUser(e, t, n);
26
- },
27
- async listUsers(e, t) {
28
- let { data: { value: n } } = await a.listUsers(e?.search, e?.filter, e?.orderBy ? /* @__PURE__ */ new Set([...e.orderBy]) : null, e?.select ? /* @__PURE__ */ new Set([...e.select]) : null, e?.expand ? /* @__PURE__ */ new Set([...e.expand]) : null, t);
29
- return n;
30
- },
31
- async getMe(e, t) {
32
- let { data: n } = await s.getOwnUser(e?.expand ? /* @__PURE__ */ new Set([...e.expand]) : /* @__PURE__ */ new Set(["memberOf"]), t);
33
- return n;
34
- },
35
- async editMe(e, t) {
36
- let { data: n } = await s.updateOwnUser(e, t);
37
- return n;
38
- },
39
- async changeOwnPassword(e, t) {
40
- await l.changeOwnPassword(e, t);
41
- },
42
- async exportPersonalData(e, t, n) {
43
- await i.exportPersonalData(e, t, n);
44
- },
45
- async createUserAppRoleAssignment(e, t, n) {
46
- let { data: r } = await u.userCreateAppRoleAssignments(e, t, n);
47
- return r;
48
- },
49
- async sendActivityNotification(e, t, n) {
50
- await d.sendActivityNotification(e, t, n);
51
- }
52
- };
53
- }, D = ({ axiosClient: e, config: t }) => {
54
- let n = b(t, t.basePath, e), r = v(t, t.basePath, e);
55
- return {
56
- async getGroup(e, t, r) {
57
- let { data: i } = await n.getGroup(e, t?.select ? /* @__PURE__ */ new Set([...t.select]) : null, t?.expand ? /* @__PURE__ */ new Set([...t.expand]) : /* @__PURE__ */ new Set(["members"]), r);
58
- return i;
59
- },
60
- async createGroup(e, t) {
61
- let { data: n } = await r.createGroup(e, t);
62
- return n;
63
- },
64
- async editGroup(e, t, r) {
65
- let { data: i } = await n.updateGroup(e, t, r);
66
- return i;
67
- },
68
- async deleteGroup(e, t, r) {
69
- await n.deleteGroup(e, t, r);
70
- },
71
- async listGroups(e, t) {
72
- let { data: { value: n } } = await r.listGroups(e?.search, e?.orderBy ? /* @__PURE__ */ new Set([...e.orderBy]) : null, e?.select ? /* @__PURE__ */ new Set([...e.select]) : null, e?.expand ? /* @__PURE__ */ new Set([...e.expand]) : null, t);
73
- return n;
74
- },
75
- async addMember(e, r, i) {
76
- await n.addMember(e, { "@odata.id": S(t.basePath, "v1.0", "users", r) }, i);
77
- },
78
- async deleteMember(e, t, r, i) {
79
- await n.deleteMember(e, t, r, i);
80
- }
81
- };
82
- }, O = ({ axiosClient: e, config: t }) => {
83
- let n = d(t, t.basePath, e);
84
- return {
85
- async getApplication(e, t) {
86
- let { data: r } = await n.getApplication(e, t);
87
- return r;
88
- },
89
- async listApplications(e) {
90
- let { data: { value: t } } = await n.listApplications(e);
91
- return t || [];
92
- }
93
- };
94
- }, k = (e) => new URL(e.webUrl).origin, A = ({ axiosClient: e, config: t }) => {
95
- let n = u(t, t.basePath, e), r = new a(t, t.basePath, e), i = new s(t, t.basePath, e);
96
- return {
97
- async getDrive(e, t, r) {
98
- let { data: i } = await n.getDrive(e, t?.select ? /* @__PURE__ */ new Set([...t.select]) : null, r);
99
- return C({
100
- ...i,
101
- serverUrl: k(i)
102
- });
103
- },
104
- async createDrive(e, t) {
105
- let { data: r } = await n.createDrive(e, t);
106
- return C({
107
- ...r,
108
- serverUrl: k(r)
109
- });
110
- },
111
- async updateDrive(e, t, r) {
112
- let { data: i } = await n.updateDrive(e, t, r);
113
- return C({
114
- ...i,
115
- serverUrl: k(i)
116
- });
117
- },
118
- async disableDrive(e, t, r) {
119
- await n.deleteDrive(e, t, r);
120
- },
121
- async deleteDrive(e, t, r) {
122
- await n.deleteDrive(e, t, {
123
- headers: {
124
- ...r?.headers && r.headers || {},
125
- Purge: "T"
126
- },
127
- ...r && { requestOptions: r } || {}
128
- });
129
- },
130
- async listMyDrives(e, t) {
131
- let { data: { value: n } } = await r.listMyDrivesBeta(e?.orderBy, e?.filter, e?.expand, e?.select ? /* @__PURE__ */ new Set([...e.select]) : null, t);
132
- return n.map((e) => C({
133
- ...e,
134
- serverUrl: k(e)
135
- }));
136
- },
137
- async listAllDrives(e, t) {
138
- let { data: { value: n } } = await i.listAllDrivesBeta(e?.orderBy, e?.filter, e?.expand, e?.select ? /* @__PURE__ */ new Set([...e.select]) : null, t);
139
- return n.map((e) => C({
140
- ...e,
141
- serverUrl: k(e)
142
- }));
143
- }
144
- };
145
- }, j = ({ axiosClient: t, config: r }) => {
146
- let i = m(r, r.basePath, t), a = n(r, r.basePath, t), o = e(r, r.basePath, t);
147
- return {
148
- async getDriveItem(e, t, n) {
149
- let { data: r } = await i.getDriveItem(e, t, void 0, n);
150
- return r;
151
- },
152
- async createDriveItem(e, t, n) {
153
- let { data: r } = await a.createDriveItem(e, null, null, t, n);
154
- return r;
155
- },
156
- async updateDriveItem(e, t, n, r) {
157
- let { data: a } = await i.updateDriveItem(e, t, n, r);
158
- return a;
159
- },
160
- async deleteDriveItem(e, t, n) {
161
- await i.deleteDriveItem(e, t, n);
162
- },
163
- async followDriveItem(e, t) {
164
- let { data: n } = await o.followDriveItem(e, t);
165
- return n;
166
- },
167
- async unfollowDriveItem(e, t) {
168
- await o.unfollowDriveItem(e, t);
169
- },
170
- async listSharedByMe(e, t) {
171
- let { data: n } = await o.listSharedByMe(e?.expand, t);
172
- return n?.value || [];
173
- },
174
- async listSharedWithMe(e, t) {
175
- let { data: n } = await o.listSharedWithMe(e?.expand, t);
176
- return n?.value || [];
177
- }
178
- };
179
- }, M = ({ axiosClient: e, config: t }) => {
180
- let n = l(t, t.basePath, e);
181
- return {
182
- async listTags(e) {
183
- let { data: { value: t } } = await n.getTags(e);
184
- return t || [];
185
- },
186
- async assignTags(e, t) {
187
- await n.assignTags(e, t);
188
- },
189
- async unassignTags(e, t) {
190
- await n.unassignTags(e, t);
191
- }
192
- };
193
- }, N = ({ axiosClient: e, config: t }) => {
194
- let n = h(t, t.basePath, e);
195
- return { async listActivities(e, t) {
196
- let { data: { value: r } } = await n.getActivities(e, t);
197
- return r || [];
198
- } };
199
- }, P = ({ axiosClient: e, config: t }) => {
200
- let r = n(t, t.basePath, e), a = p(t, t.basePath, e), o = i(t, t.basePath, e);
201
- return {
202
- async getPermission(e, t, n, r, i) {
203
- let { data: a } = await o.getPermission(e, t, n, i);
204
- return a.link ? w({
205
- graphPermission: a,
206
- resourceId: t
207
- }) : T({
208
- graphPermission: a,
209
- resourceId: t,
210
- graphRoles: r || {}
211
- });
212
- },
213
- async listPermissions(e, t, n, i, a) {
214
- let s;
215
- if (e === t) {
216
- let { data: t } = await r.listPermissionsSpaceRoot(e, i?.filter, i?.select ? /* @__PURE__ */ new Set([...i.select]) : null, i?.count, i?.top || 0, a);
217
- s = t;
218
- } else {
219
- let { data: n } = await o.listPermissions(e, t, i?.filter, i?.select ? /* @__PURE__ */ new Set([...i.select]) : null, i?.count, i?.top || 0, a);
220
- s = n;
221
- }
222
- let c = s.value || [], l = s["@libre.graph.permissions.actions.allowedValues"], u = s["@libre.graph.permissions.roles.allowedValues"], d = s["@odata.count"];
223
- return {
224
- shares: c.map((e) => e.link ? w({
225
- graphPermission: e,
226
- resourceId: t
227
- }) : T({
228
- graphPermission: e,
229
- resourceId: t,
230
- graphRoles: n || {}
231
- })),
232
- allowedActions: l,
233
- allowedRoles: u,
234
- count: d
235
- };
236
- },
237
- async updatePermission(e, t, n, i, a, s) {
238
- let c;
239
- if (e === t) {
240
- let { data: t } = await r.updatePermissionSpaceRoot(e, n, i, s);
241
- c = t;
242
- } else {
243
- let { data: r } = await o.updatePermission(e, t, n, i, s);
244
- c = r;
245
- }
246
- return c.link ? w({
247
- graphPermission: c,
248
- resourceId: t
249
- }) : T({
250
- graphPermission: c,
251
- resourceId: t,
252
- graphRoles: a || {}
253
- });
254
- },
255
- async deletePermission(e, t, n, i) {
256
- if (e === t) {
257
- await r.deletePermissionSpaceRoot(e, n, i);
258
- return;
259
- }
260
- await o.deletePermission(e, t, n, i);
261
- },
262
- async createInvite(e, t, n, i, a) {
263
- let s;
264
- if (e === t) {
265
- let { data: t } = await r.inviteSpaceRoot(e, n, a);
266
- s = t.value?.[0];
267
- } else {
268
- let { data: r } = await o.invite(e, t, n, a);
269
- s = r.value?.[0];
270
- }
271
- if (!s) throw Error("no permission returned");
272
- return T({
273
- graphPermission: s,
274
- resourceId: t,
275
- graphRoles: i || {}
276
- });
277
- },
278
- async createLink(e, t, n, i) {
279
- let a;
280
- if (e === t) {
281
- let { data: t } = await r.createLinkSpaceRoot(e, n, i);
282
- a = t;
283
- } else {
284
- let { data: r } = await o.createLink(e, t, n, i);
285
- a = r;
286
- }
287
- return w({
288
- graphPermission: a,
289
- resourceId: t
290
- });
291
- },
292
- async setPermissionPassword(e, t, n, i, a) {
293
- let s;
294
- if (e === t) {
295
- let { data: t } = await r.setPermissionPasswordSpaceRoot(e, n, i, a);
296
- s = t;
297
- } else {
298
- let { data: r } = await o.setPermissionPassword(e, t, n, i, a);
299
- s = r;
300
- }
301
- return w({
302
- graphPermission: s,
303
- resourceId: t
304
- });
305
- },
306
- async listRoleDefinitions(e) {
307
- let { data: t } = await a.listPermissionRoleDefinitions(e);
308
- return t;
309
- }
310
- };
311
- }, F = ({ axiosClient: e, config: t }) => {
312
- let n = g(t, t.basePath, e), r = _(t, t.basePath, e);
313
- return {
314
- async getOwnUserPhoto(e) {
315
- let { data: t } = await n.getOwnUserPhoto(e);
316
- return t;
317
- },
318
- async deleteOwnUserPhoto(e) {
319
- let { data: t } = await n.deleteOwnUserPhoto(e);
320
- return t;
321
- },
322
- async updateOwnUserPhotoPatch(e, t) {
323
- let { data: r } = await n.updateOwnUserPhotoPatch(e, t);
324
- return r;
325
- },
326
- async getUserPhoto(e, t) {
327
- let { data: n } = await r.getUserPhoto(e, t);
328
- return n;
329
- }
330
- };
331
- }, I = (e, t) => {
332
- let n = new URL(e);
333
- n.pathname = [...n.pathname.split("/"), "graph"].filter(Boolean).join("/");
334
- let r = new y({ basePath: n.href });
335
- return {
336
- activities: N({
337
- axiosClient: t,
338
- config: r
339
- }),
340
- applications: O({
341
- axiosClient: t,
342
- config: r
343
- }),
344
- tags: M({
345
- axiosClient: t,
346
- config: r
347
- }),
348
- drives: A({
349
- axiosClient: t,
350
- config: r
351
- }),
352
- driveItems: j({
353
- axiosClient: t,
354
- config: r
355
- }),
356
- users: E({
357
- axiosClient: t,
358
- config: r
359
- }),
360
- groups: D({
361
- axiosClient: t,
362
- config: r
363
- }),
364
- permissions: P({
365
- axiosClient: t,
366
- config: r
367
- }),
368
- photos: F({
369
- axiosClient: t,
370
- config: r
371
- })
372
- };
373
- };
374
- //#endregion
375
- export { I as t };