@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.
@@ -0,0 +1,376 @@
1
+ import { t as e } from "./axios-CiL7Z3dm.js";
2
+ import { C as t, Cn as n, Dn as r, Fn as i, Jt as a, N as o, Un as s, Wt as c, c as l, g as u, i as d, in as f, jn as p, k as m, mn as h, mt as g, t as _, un as v, vn as y, vt as b, x, zn as S } from "./generated-5SvS30Rr.js";
3
+ import { t as C } from "./urlJoin-_pUL1TUx.js";
4
+ import { m as w, r as T, t as E } from "./helpers-CrYtf7Ol.js";
5
+ //#region ../../node_modules/.pnpm/axios@1.20.0_debug@4.4.3_supports-color@7.2.0__supports-color@7.2.0/node_modules/axios/index.js
6
+ var { Axios: ee, AxiosError: D, CanceledError: O, isCancel: k, CancelToken: A, VERSION: j, all: M, Cancel: N, isAxiosError: P, spread: F, toFormData: I, AxiosHeaders: L, HttpStatusCode: R, formToJSON: z, getAdapter: B, mergeConfig: V, create: H } = e, U = ({ axiosClient: e, config: t }) => {
7
+ let n = r(t, t.basePath, e), i = s(t, t.basePath, e), a = h(t, t.basePath, e), o = c(t, t.basePath, e), l = p(t, t.basePath, e), u = S(t, t.basePath, e);
8
+ return {
9
+ async getUser(e, t, r) {
10
+ let { data: i } = await n.getUser(e, t?.select ? /* @__PURE__ */ new Set([...t.select]) : null, t?.expand ? /* @__PURE__ */ new Set([...t.expand]) : /* @__PURE__ */ new Set([
11
+ "drive",
12
+ "memberOf",
13
+ "appRoleAssignments"
14
+ ]), r);
15
+ return i;
16
+ },
17
+ async createUser(e, t) {
18
+ let { data: n } = await i.createUser(e, t);
19
+ return n;
20
+ },
21
+ async editUser(e, t, r) {
22
+ let { data: i } = await n.updateUser(e, t, r);
23
+ return i;
24
+ },
25
+ async deleteUser(e, t, r) {
26
+ await n.deleteUser(e, t, r);
27
+ },
28
+ async listUsers(e, t) {
29
+ let { data: { value: n } } = await i.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);
30
+ return n;
31
+ },
32
+ async getMe(e, t) {
33
+ let { data: n } = await a.getOwnUser(e?.expand ? /* @__PURE__ */ new Set([...e.expand]) : /* @__PURE__ */ new Set(["memberOf"]), t);
34
+ return n;
35
+ },
36
+ async editMe(e, t) {
37
+ let { data: n } = await a.updateOwnUser(e, t);
38
+ return n;
39
+ },
40
+ async changeOwnPassword(e, t) {
41
+ await o.changeOwnPassword(e, t);
42
+ },
43
+ async exportPersonalData(e, t, r) {
44
+ await n.exportPersonalData(e, t, r);
45
+ },
46
+ async createUserAppRoleAssignment(e, t, n) {
47
+ let { data: r } = await l.userCreateAppRoleAssignments(e, t, n);
48
+ return r;
49
+ },
50
+ async sendActivityNotification(e, t, n) {
51
+ await u.sendActivityNotification(e, t, n);
52
+ }
53
+ };
54
+ }, W = ({ axiosClient: e, config: t }) => {
55
+ let n = g(t, t.basePath, e), r = b(t, t.basePath, e);
56
+ return {
57
+ async getGroup(e, t, r) {
58
+ 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);
59
+ return i;
60
+ },
61
+ async createGroup(e, t) {
62
+ let { data: n } = await r.createGroup(e, t);
63
+ return n;
64
+ },
65
+ async editGroup(e, t, r) {
66
+ let { data: i } = await n.updateGroup(e, t, r);
67
+ return i;
68
+ },
69
+ async deleteGroup(e, t, r) {
70
+ await n.deleteGroup(e, t, r);
71
+ },
72
+ async listGroups(e, t) {
73
+ 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);
74
+ return n;
75
+ },
76
+ async addMember(e, r, i) {
77
+ await n.addMember(e, { "@odata.id": C(t.basePath, "v1.0", "users", r) }, i);
78
+ },
79
+ async deleteMember(e, t, r, i) {
80
+ await n.deleteMember(e, t, r, i);
81
+ }
82
+ };
83
+ }, G = ({ axiosClient: e, config: t }) => {
84
+ let n = l(t, t.basePath, e);
85
+ return {
86
+ async getApplication(e, t) {
87
+ let { data: r } = await n.getApplication(e, t);
88
+ return r;
89
+ },
90
+ async listApplications(e) {
91
+ let { data: { value: t } } = await n.listApplications(e);
92
+ return t || [];
93
+ }
94
+ };
95
+ }, K = (e) => new URL(e.webUrl).origin, q = ({ axiosClient: e, config: n }) => {
96
+ let r = x(n, n.basePath, e), i = new f(n, n.basePath, e), a = new t(n, n.basePath, e);
97
+ return {
98
+ async getDrive(e, t, n) {
99
+ let { data: i } = await r.getDrive(e, t?.select ? /* @__PURE__ */ new Set([...t.select]) : null, n);
100
+ return w({
101
+ ...i,
102
+ serverUrl: K(i)
103
+ });
104
+ },
105
+ async createDrive(e, t) {
106
+ let { data: n } = await r.createDrive(e, t);
107
+ return w({
108
+ ...n,
109
+ serverUrl: K(n)
110
+ });
111
+ },
112
+ async updateDrive(e, t, n) {
113
+ let { data: i } = await r.updateDrive(e, t, n);
114
+ return w({
115
+ ...i,
116
+ serverUrl: K(i)
117
+ });
118
+ },
119
+ async disableDrive(e, t, n) {
120
+ await r.deleteDrive(e, t, n);
121
+ },
122
+ async deleteDrive(e, t, n) {
123
+ await r.deleteDrive(e, t, {
124
+ ...n,
125
+ headers: {
126
+ ...n?.headers,
127
+ common: new L({ Purge: "T" })
128
+ }
129
+ });
130
+ },
131
+ async listMyDrives(e, t) {
132
+ let { data: { value: n } } = await i.listMyDrivesBeta(e?.orderBy, e?.filter, e?.expand, e?.select ? /* @__PURE__ */ new Set([...e.select]) : null, t);
133
+ return n.map((e) => w({
134
+ ...e,
135
+ serverUrl: K(e)
136
+ }));
137
+ },
138
+ async listAllDrives(e, t) {
139
+ let { data: { value: n } } = await a.listAllDrivesBeta(e?.orderBy, e?.filter, e?.expand, e?.select ? /* @__PURE__ */ new Set([...e.select]) : null, t);
140
+ return n.map((e) => w({
141
+ ...e,
142
+ serverUrl: K(e)
143
+ }));
144
+ }
145
+ };
146
+ }, J = ({ axiosClient: e, config: t }) => {
147
+ let n = u(t, t.basePath, e), r = o(t, t.basePath, e), i = a(t, t.basePath, e);
148
+ return {
149
+ async getDriveItem(e, t, r) {
150
+ let { data: i } = await n.getDriveItem(e, t, void 0, void 0, r);
151
+ return i;
152
+ },
153
+ async createDriveItem(e, t, n) {
154
+ let { data: i } = await r.createDriveItem(e, null, null, t, n);
155
+ return i;
156
+ },
157
+ async updateDriveItem(e, t, r, i) {
158
+ let { data: a } = await n.updateDriveItem(e, t, r, i);
159
+ return a;
160
+ },
161
+ async deleteDriveItem(e, t, r) {
162
+ await n.deleteDriveItem(e, t, r);
163
+ },
164
+ async followDriveItem(e, t) {
165
+ let { data: n } = await i.followDriveItem(e, t);
166
+ return n;
167
+ },
168
+ async unfollowDriveItem(e, t) {
169
+ await i.unfollowDriveItem(e, t);
170
+ },
171
+ async listSharedByMe(e, t) {
172
+ let { data: n } = await i.listSharedByMe(e?.expand, t);
173
+ return n?.value || [];
174
+ },
175
+ async listSharedWithMe(e, t) {
176
+ let { data: n } = await i.listSharedWithMe(e?.expand, t);
177
+ return n?.value || [];
178
+ }
179
+ };
180
+ }, Y = ({ axiosClient: e, config: t }) => {
181
+ let r = n(t, t.basePath, e);
182
+ return {
183
+ async listTags(e) {
184
+ let { data: { value: t } } = await r.getTags(e);
185
+ return t || [];
186
+ },
187
+ async assignTags(e, t) {
188
+ await r.assignTags(e, t);
189
+ },
190
+ async unassignTags(e, t) {
191
+ await r.unassignTags(e, t);
192
+ }
193
+ };
194
+ }, X = ({ axiosClient: e, config: t }) => {
195
+ let n = d(t, t.basePath, e);
196
+ return { async listActivities(e, t) {
197
+ let { data: { value: r } } = await n.getActivities(e, t);
198
+ return r || [];
199
+ } };
200
+ }, Z = ({ axiosClient: e, config: t }) => {
201
+ let n = o(t, t.basePath, e), r = y(t, t.basePath, e), i = m(t, t.basePath, e);
202
+ return {
203
+ async getPermission(e, t, n, r, a) {
204
+ let { data: o } = await i.getPermission(e, t, n, a);
205
+ return o.link ? T({
206
+ graphPermission: o,
207
+ resourceId: t
208
+ }) : E({
209
+ graphPermission: o,
210
+ resourceId: t,
211
+ graphRoles: r || {}
212
+ });
213
+ },
214
+ async listPermissions(e, t, r, a, o) {
215
+ let s;
216
+ if (e === t) {
217
+ let { data: t } = await n.listPermissionsSpaceRoot(e, a?.filter, a?.select ? /* @__PURE__ */ new Set([...a.select]) : null, a?.count, a?.top || 0, o);
218
+ s = t;
219
+ } else {
220
+ let { data: n } = await i.listPermissions(e, t, a?.filter, a?.select ? /* @__PURE__ */ new Set([...a.select]) : null, a?.count, a?.top || 0, o);
221
+ s = n;
222
+ }
223
+ let c = s.value || [], l = s["@libre.graph.permissions.actions.allowedValues"], u = s["@libre.graph.permissions.roles.allowedValues"], d = s["@odata.count"];
224
+ return {
225
+ shares: c.map((e) => e.link ? T({
226
+ graphPermission: e,
227
+ resourceId: t
228
+ }) : E({
229
+ graphPermission: e,
230
+ resourceId: t,
231
+ graphRoles: r || {}
232
+ })),
233
+ allowedActions: l,
234
+ allowedRoles: u,
235
+ count: d
236
+ };
237
+ },
238
+ async updatePermission(e, t, r, a, o, s) {
239
+ let c;
240
+ if (e === t) {
241
+ let { data: t } = await n.updatePermissionSpaceRoot(e, r, a, s);
242
+ c = t;
243
+ } else {
244
+ let { data: n } = await i.updatePermission(e, t, r, a, s);
245
+ c = n;
246
+ }
247
+ return c.link ? T({
248
+ graphPermission: c,
249
+ resourceId: t
250
+ }) : E({
251
+ graphPermission: c,
252
+ resourceId: t,
253
+ graphRoles: o || {}
254
+ });
255
+ },
256
+ async deletePermission(e, t, r, a) {
257
+ if (e === t) {
258
+ await n.deletePermissionSpaceRoot(e, r, a);
259
+ return;
260
+ }
261
+ await i.deletePermission(e, t, r, a);
262
+ },
263
+ async createInvite(e, t, r, a, o) {
264
+ let s;
265
+ if (e === t) {
266
+ let { data: t } = await n.inviteSpaceRoot(e, r, o);
267
+ s = t.value?.[0];
268
+ } else {
269
+ let { data: n } = await i.invite(e, t, r, o);
270
+ s = n.value?.[0];
271
+ }
272
+ if (!s) throw Error("no permission returned");
273
+ return E({
274
+ graphPermission: s,
275
+ resourceId: t,
276
+ graphRoles: a || {}
277
+ });
278
+ },
279
+ async createLink(e, t, r, a) {
280
+ let o;
281
+ if (e === t) {
282
+ let { data: t } = await n.createLinkSpaceRoot(e, r, a);
283
+ o = t;
284
+ } else {
285
+ let { data: n } = await i.createLink(e, t, r, a);
286
+ o = n;
287
+ }
288
+ return T({
289
+ graphPermission: o,
290
+ resourceId: t
291
+ });
292
+ },
293
+ async setPermissionPassword(e, t, r, a, o) {
294
+ let s;
295
+ if (e === t) {
296
+ let { data: t } = await n.setPermissionPasswordSpaceRoot(e, r, a, o);
297
+ s = t;
298
+ } else {
299
+ let { data: n } = await i.setPermissionPassword(e, t, r, a, o);
300
+ s = n;
301
+ }
302
+ return T({
303
+ graphPermission: s,
304
+ resourceId: t
305
+ });
306
+ },
307
+ async listRoleDefinitions(e) {
308
+ let { data: t } = await r.listPermissionRoleDefinitions(e);
309
+ return t;
310
+ }
311
+ };
312
+ }, Q = ({ axiosClient: e, config: t }) => {
313
+ let n = v(t, t.basePath, e), r = i(t, t.basePath, e);
314
+ return {
315
+ async getOwnUserPhoto(e) {
316
+ let { data: t } = await n.getOwnUserPhoto(e);
317
+ return t;
318
+ },
319
+ async deleteOwnUserPhoto(e) {
320
+ let { data: t } = await n.deleteOwnUserPhoto(e);
321
+ return t;
322
+ },
323
+ async updateOwnUserPhotoPatch(e, t) {
324
+ let { data: r } = await n.updateOwnUserPhotoPatch(e, t);
325
+ return r;
326
+ },
327
+ async getUserPhoto(e, t) {
328
+ let { data: n } = await r.getUserPhoto(e, t);
329
+ return n;
330
+ }
331
+ };
332
+ }, $ = (e, t) => {
333
+ let n = new URL(e);
334
+ n.pathname = [...n.pathname.split("/"), "graph"].filter(Boolean).join("/");
335
+ let r = new _({ basePath: n.href });
336
+ return {
337
+ activities: X({
338
+ axiosClient: t,
339
+ config: r
340
+ }),
341
+ applications: G({
342
+ axiosClient: t,
343
+ config: r
344
+ }),
345
+ tags: Y({
346
+ axiosClient: t,
347
+ config: r
348
+ }),
349
+ drives: q({
350
+ axiosClient: t,
351
+ config: r
352
+ }),
353
+ driveItems: J({
354
+ axiosClient: t,
355
+ config: r
356
+ }),
357
+ users: U({
358
+ axiosClient: t,
359
+ config: r
360
+ }),
361
+ groups: W({
362
+ axiosClient: t,
363
+ config: r
364
+ }),
365
+ permissions: Z({
366
+ axiosClient: t,
367
+ config: r
368
+ }),
369
+ photos: Q({
370
+ axiosClient: t,
371
+ config: r
372
+ })
373
+ };
374
+ };
375
+ //#endregion
376
+ export { $ as t };
@@ -1,6 +1,6 @@
1
- import { a as e, i as t, n, r } from "./axios-CAceQWl5.js";
1
+ import { a as e, i as t, n, r } from "./axios-CiL7Z3dm.js";
2
2
  import { t as i } from "./urlJoin-_pUL1TUx.js";
3
- import { c as a, i as o, l as s, n as c, o as l, r as u, t as d } from "./toString-Y_fh2BSJ.js";
3
+ import { c as a, i as o, l as s, n as c, o as l, r as u, t as d } from "./toString-CVetDRwx.js";
4
4
  //#region src/helpers/publicLink/functions.ts
5
5
  function f(e, t = "") {
6
6
  return `/public-files/${e}/${t}`.split("/").filter(Boolean).join("/");
@@ -225,6 +225,10 @@ var m = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
225
225
  value: "photo",
226
226
  type: null
227
227
  },
228
+ MotionPhoto: {
229
+ value: "motion-photo",
230
+ type: null
231
+ },
228
232
  ETag: v("getetag"),
229
233
  MimeType: v("getcontenttype"),
230
234
  ResourceType: ((e) => _(e))("resourcetype"),
@@ -287,6 +291,7 @@ var m = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
287
291
  b.Location,
288
292
  b.Image,
289
293
  b.Photo,
294
+ b.MotionPhoto,
290
295
  b.HasPreview
291
296
  ];
292
297
  static PublicLink = e.Default.concat([
@@ -939,6 +944,7 @@ function nn(e, t = []) {
939
944
  location: U(e.props[b.Location]),
940
945
  image: U(e.props[b.Image]),
941
946
  photo: U(e.props[b.Photo]),
947
+ motionPhoto: U(e.props[b.MotionPhoto]),
942
948
  extraProps: f,
943
949
  hasPreview: () => e.props[b.HasPreview] === 1,
944
950
  canUpload: function() {
@@ -1447,7 +1453,7 @@ function Dn({ graphPermission: e, resourceId: t, indirect: n = !1 }) {
1447
1453
  };
1448
1454
  }
1449
1455
  function $({ link: e, grantedToV2: t }) {
1450
- return e ? q.link.value : t?.group ? q.group.value : t?.user?.["@libre.graph.userType"] === "Federated" ? q.remote.value : q.user.value;
1456
+ return e ? q.link.value : t?.group ? q.group.value : t?.user?.["@libre.graph.userType"] === "Guest" ? q.guest.value : t?.user?.["@libre.graph.userType"] === "Federated" ? q.remote.value : q.user.value;
1451
1457
  }
1452
1458
  //#endregion
1453
1459
  export { q as A, Zt as B, un as C, ln as D, dn as E, H as F, h as G, Xt as H, $t as I, p as J, re as K, V as L, rn as M, nn as N, sn as O, z as P, en as R, an as S, cn as T, g as U, tn as V, ne as W, f as Y, X as _, Cn as a, pn as b, yn as c, Q as d, hn as f, Y as g, _n as h, Tn as i, W as j, K as k, xn as l, Z as m, wn as n, Sn as o, gn as p, b as q, Dn as r, bn as s, En as t, vn as u, fn as v, J as w, on as x, mn as y, B as z };