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