@opencloud-eu/web-client 8.1.0 → 8.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.
- package/dist/{axios-CiL7Z3dm.js → axios-DRPhbClr.js} +13 -49
- package/dist/{dist-p2k0FYjB.js → dist-CHy-DaIN.js} +1 -1
- package/dist/{generated-5SvS30Rr.js → generated-4nR8KA38.js} +435 -267
- package/dist/{graph-u53S3WT9.js → graph-CwVan2Jp.js} +148 -123
- package/dist/{helpers-CrYtf7Ol.js → helpers-Bh5xR_vg.js} +45 -36
- package/dist/{ocs-CDSkdguM.js → ocs-Dfdjrujs.js} +407 -432
- package/dist/{schemas-BlxXwTjV.js → schemas-rdabTCJb.js} +1014 -1008
- package/dist/src/errors.d.ts +2 -1
- package/dist/src/graph/generated/api.d.ts +527 -0
- package/dist/src/graph/guestLinks/guestLinks.d.ts +3 -0
- package/dist/src/graph/guestLinks/index.d.ts +2 -0
- package/dist/src/graph/guestLinks/types.d.ts +13 -0
- package/dist/src/graph/index.d.ts +3 -0
- package/dist/src/graph/types.d.ts +1 -0
- package/dist/src/helpers/resource/types.d.ts +2 -1
- package/dist/src/helpers/share/types.d.ts +3 -0
- package/dist/src/helpers/space/functions.d.ts +2 -2
- package/dist/src/ocs/capabilities.d.ts +1 -0
- package/dist/src/webdav/client/dav.d.ts +3 -1
- package/dist/src/webdav/client/parsers.d.ts +1 -0
- package/dist/src/webdav/constants/dav.d.ts +5 -1
- package/dist/src/webdav/index.d.ts +1 -1
- package/dist/{toString-CVetDRwx.js → toString-uorCN9F3.js} +1 -1
- package/dist/web-client/graph/generated.js +1 -2
- package/dist/web-client/graph.js +1 -2
- package/dist/web-client/ocs.js +1 -2
- package/dist/web-client/ox.js +1 -1
- package/dist/web-client/sse.js +1 -1
- package/dist/web-client/webdav.js +2 -2
- package/dist/web-client.js +4 -4
- package/dist/{webdav-BdeuuZHv.js → webdav-DrQsSfxZ.js} +95 -86
- package/package.json +1 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DavFileInfoResponse } from '@opencloud-eu/web-client/webdav';
|
|
2
|
-
import { Audio, GeoCoordinates, Identity, Image, MotionPhoto, Photo, User } from '../../graph/generated';
|
|
2
|
+
import { Audio, GeoCoordinates, Identity, Image, LivePhoto, MotionPhoto, Photo, User } from '../../graph/generated';
|
|
3
3
|
import { MongoAbility, SubjectRawRule } from '@casl/ability';
|
|
4
4
|
import { DAVResultResponseProps, FileStat } from 'webdav';
|
|
5
5
|
export type AbilityActions = 'create' | 'create-all' | 'delete' | 'delete-all' | 'read' | 'read-all' | 'set-quota' | 'set-quota-all' | 'update' | 'update-all';
|
|
@@ -19,6 +19,7 @@ export interface Resource {
|
|
|
19
19
|
image?: Image;
|
|
20
20
|
photo?: Photo;
|
|
21
21
|
motionPhoto?: MotionPhoto;
|
|
22
|
+
livePhoto?: LivePhoto;
|
|
22
23
|
path: string;
|
|
23
24
|
webDavPath?: string;
|
|
24
25
|
downloadURL?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Identity, ObjectIdentity, SharingLinkType, UnifiedRoleDefinition } from '../../graph/generated';
|
|
2
2
|
import { Resource } from '../resource';
|
|
3
|
+
import type { SpaceResource } from '../space/types';
|
|
3
4
|
export declare enum GraphSharePermission {
|
|
4
5
|
createUpload = "libre.graph/driveItem/upload/create",
|
|
5
6
|
createPermissions = "libre.graph/driveItem/permissions/create",
|
|
@@ -31,6 +32,8 @@ export interface ShareResource extends Resource {
|
|
|
31
32
|
}
|
|
32
33
|
export interface OutgoingShareResource extends ShareResource {
|
|
33
34
|
}
|
|
35
|
+
export interface LinkSharedSpaceResource extends SpaceResource, Pick<ShareResource, 'sdate'> {
|
|
36
|
+
}
|
|
34
37
|
export interface IncomingShareResource extends ShareResource {
|
|
35
38
|
hidden: boolean;
|
|
36
39
|
syncEnabled: boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Resource } from '../resource';
|
|
2
2
|
import { PublicSpaceResource, ShareSpaceResource, SpaceResource } from './types';
|
|
3
|
-
import { Drive } from '@opencloud-eu/web-client/graph/generated';
|
|
3
|
+
import { Drive, Permission } from '@opencloud-eu/web-client/graph/generated';
|
|
4
4
|
import { CollaboratorShare, GraphSharePermission, ShareRole } from '../share';
|
|
5
5
|
export declare function buildWebDavSpacesPath(storageId: string, path?: string): string;
|
|
6
6
|
export declare function buildWebDavSpacesTrashPath(storageId: string, path?: string): string;
|
|
7
7
|
export declare function getRelativeSpecialFolderSpacePath(space: SpaceResource, type: 'image' | 'readme'): string;
|
|
8
8
|
export declare function isManager(share: CollaboratorShare): boolean;
|
|
9
|
-
export declare const getSpaceManagers: (space: SpaceResource, graphRoles: Record<string, ShareRole>) =>
|
|
9
|
+
export declare const getSpaceManagers: (space: SpaceResource, graphRoles: Record<string, ShareRole>) => Permission[];
|
|
10
10
|
export type PublicLinkType = 'ocm' | 'public-link';
|
|
11
11
|
export declare function buildPublicSpaceResource(data: any & {
|
|
12
12
|
publicLinkType: PublicLinkType;
|
|
@@ -5,6 +5,7 @@ import { WebDavResponseResource } from '../../helpers';
|
|
|
5
5
|
export interface DAVOptions {
|
|
6
6
|
baseUrl: string;
|
|
7
7
|
headers?: () => Headers;
|
|
8
|
+
withCredentials?: () => boolean;
|
|
8
9
|
}
|
|
9
10
|
export interface DavResult {
|
|
10
11
|
body: WebDavResponseResource[] | undefined;
|
|
@@ -19,8 +20,9 @@ export declare class DAV {
|
|
|
19
20
|
private client;
|
|
20
21
|
private davPath;
|
|
21
22
|
private headers;
|
|
23
|
+
private withCredentials;
|
|
22
24
|
extraProps: string[];
|
|
23
|
-
constructor({ baseUrl, headers }: DAVOptions);
|
|
25
|
+
constructor({ baseUrl, headers, withCredentials }: DAVOptions);
|
|
24
26
|
mkcol(path: string, opts?: DAVRequestOptions): Promise<DavResult>;
|
|
25
27
|
propfind(path: string, { depth, properties, extraProps, headers, ...opts }?: {
|
|
26
28
|
depth?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Audio, GeoCoordinates, Image, MotionPhoto, Photo } from '../../graph/generated';
|
|
1
|
+
import { Audio, GeoCoordinates, Image, LivePhoto, MotionPhoto, Photo } from '../../graph/generated';
|
|
2
2
|
export declare abstract class DavPermission {
|
|
3
3
|
static readonly Shared: string;
|
|
4
4
|
static readonly Shareable: string;
|
|
@@ -62,6 +62,10 @@ declare const DavPropertyMapping: {
|
|
|
62
62
|
readonly value: "motion-photo";
|
|
63
63
|
readonly type: MotionPhoto;
|
|
64
64
|
};
|
|
65
|
+
readonly LivePhoto: {
|
|
66
|
+
readonly value: "live-photo";
|
|
67
|
+
readonly type: LivePhoto;
|
|
68
|
+
};
|
|
65
69
|
readonly ETag: M<"getetag", string>;
|
|
66
70
|
readonly MimeType: M<"getcontenttype", string>;
|
|
67
71
|
readonly ResourceType: M<"resourcetype", string[]>;
|
|
@@ -4,4 +4,4 @@ export * from './constants';
|
|
|
4
4
|
export * from './types';
|
|
5
5
|
export type { ListFilesOptions, ListFilesResult } from './listFiles';
|
|
6
6
|
export type { GetFileContentsResponse } from './getFileContents';
|
|
7
|
-
export declare const webdav: (baseURI: string, headers?: () => Headers) => WebDAV;
|
|
7
|
+
export declare const webdav: (baseURI: string, headers?: () => Headers, withCredentials?: () => boolean) => WebDAV;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./dist-
|
|
1
|
+
import { t as e } from "./dist-CHy-DaIN.js";
|
|
2
2
|
//#region ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js
|
|
3
3
|
var t = typeof e == "object" && e && e.Object === Object && e, n = typeof self == "object" && self && self.Object === Object && self, r = t || n || Function("return this")(), i = r.Symbol, a = Object.prototype, ee = a.hasOwnProperty, te = a.toString, o = i ? i.toStringTag : void 0;
|
|
4
4
|
function ne(e) {
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { ot as ActivitiesApi, _t as ActivitiesApiAxiosParamCreator, Ge as ActivitiesApiFactory, Se as ActivitiesApiFp, lt as ApplicationsApi, bt as ApplicationsApiAxiosParamCreator, Oe as ApplicationsApiFactory, et as ApplicationsApiFp, Ct as Configuration, Et as CreateChildDriveItemAtLibreGraphConflictBehaviorEnum, je as CreateChildDriveItemAtLibreGraphMissingParentsBehaviorEnum, Ie as CreateDriveItemAtLibreGraphConflictBehaviorEnum, ft as CreateDriveItemAtLibreGraphMissingParentsBehaviorEnum, rt as DriveItemApi, He as DriveItemApiAxiosParamCreator, ze as DriveItemApiFactory, ye as DriveItemApiFp, kt as DriveItemAtLibreGraphShareTypesEnum, Rt as DrivesApi, Te as DrivesApiAxiosParamCreator, Ft as DrivesApiFactory, Q as DrivesApiFp, c as DrivesGetDrivesApi, Mt as DrivesGetDrivesApiAxiosParamCreator, te as DrivesGetDrivesApiFactory, m as DrivesGetDrivesApiFp, d as DrivesPermissionsApi, V as DrivesPermissionsApiAxiosParamCreator, Ze as DrivesPermissionsApiFactory, n as DrivesPermissionsApiFp, Je as DrivesRootApi, F as DrivesRootApiAxiosParamCreator, R as DrivesRootApiFactory, W as DrivesRootApiFp, _ as EducationClassApi, T as EducationClassApiAxiosParamCreator, M as EducationClassApiFactory, Y as EducationClassApiFp, Vt as EducationClassClassificationEnum, a as EducationClassTeachersApi, se as EducationClassTeachersApiAxiosParamCreator, S as EducationClassTeachersApiFactory, ie as EducationClassTeachersApiFp, ue as EducationSchoolApi, b as EducationSchoolApiAxiosParamCreator, A as EducationSchoolApiFactory, ht as EducationSchoolApiFp, O as EducationUserApi, he as EducationUserApiAxiosParamCreator, pe as EducationUserApiFactory, _e as EducationUserApiFp, q as GetDriveItemChildrenSelectEnum, e as GetDriveItemExpandEnum, Fe as GetDriveItemSelectEnum, Tt as GetDriveItemV1ExpandEnum, ct as GetDriveItemV1SelectEnum, yt as GetDriveSelectEnum, qe as GetEducationUserExpandEnum, we as GetGroupExpandEnum, dt as GetGroupSelectEnum, St as GetOwnUserExpandEnum, Ae as GetRootExpandEnum, nt as GetRootSelectEnum, Ot as GetUserExpandEnum, Ne as GetUserSelectEnum, Re as GroupApi, mt as GroupApiAxiosParamCreator, at as GroupApiFactory, We as GroupApiFp, Ve as GroupsApi, xe as GroupsApiAxiosParamCreator, jt as GroupsApiFactory, Bt as GroupsApiFp, De as HomeGetChildrenSelectEnum, Lt as HomeGetRootExpandEnum, ee as HomeGetRootSelectEnum, u as InvitationsApi, Pt as InvitationsApiAxiosParamCreator, re as InvitationsApiFactory, g as InvitationsApiFp, p as ListAllDrivesBetaSelectEnum, U as ListEducationUsersExpandEnum, $e as ListEducationUsersOrderbyEnum, i as ListGroupsExpandEnum, Xe as ListGroupsOrderbyEnum, L as ListGroupsSelectEnum, B as ListMyDrivesBetaSelectEnum, K as ListPermissionsSelectEnum, y as ListPermissionsSpaceRootSelectEnum, D as ListSharedByMeExpandEnum, P as ListSharedWithMeExpandEnum, Z as ListUsersExpandEnum, Ut as ListUsersOrderbyEnum, s as ListUsersSelectEnum, le as LockInfoLockTypeEnum, w as MeChangepasswordApi, oe as MeChangepasswordApiAxiosParamCreator, fe as MeChangepasswordApiFactory, x as MeChangepasswordApiFp, j as MeDriveApi, gt as MeDriveApiAxiosParamCreator, k as MeDriveApiFactory, ge as MeDriveApiFp, me as MeDriveRootApi, ve as MeDriveRootApiAxiosParamCreator, J as MeDriveRootApiFactory, t as MeDriveRootApiFp, Pe as MeDriveRootChildrenApi, wt as MeDriveRootChildrenApiAxiosParamCreator, st as MeDriveRootChildrenApiFactory, vt as MeDriveRootChildrenApiFp, Ke as MeDrivesApi, Ce as MeDrivesApiAxiosParamCreator, ut as MeDrivesApiFactory, xt as MeDrivesApiFp, ke as MePhotoApi, tt as MePhotoApiAxiosParamCreator, Dt as MePhotoApiFactory, Me as MePhotoApiFp, Le as MeUserApi, pt as MeUserApiAxiosParamCreator, it as MeUserApiFactory, Ue as MeUserApiFp, Be as RoleManagementApi, be as RoleManagementApiAxiosParamCreator, At as RoleManagementApiFactory, zt as RoleManagementApiFp, Ee as SharingLinkType, It as TagsApi, $ as TagsApiAxiosParamCreator, l as TagsApiFactory, Nt as TagsApiFp, ne as UserApi, h as UserApiAxiosParamCreator, f as UserApiFactory, H as UserApiFp, Qe as UserAppRoleAssignmentApi, r as UserAppRoleAssignmentApiAxiosParamCreator, Ye as UserAppRoleAssignmentApiFactory, I as UserAppRoleAssignmentApiFp, z as UserPhotoApi, G as UserPhotoApiAxiosParamCreator, v as UserPhotoApiFactory, E as UserPhotoApiFp, N as UserTeamworkApi, X as UserTeamworkApiAxiosParamCreator, Ht as UserTeamworkApiFactory, o as UserTeamworkApiFp, ce as UsersApi, C as UsersApiAxiosParamCreator, ae as UsersApiFactory, de as UsersApiFp };
|
|
1
|
+
export { n as ActivitiesApi, r as ActivitiesApiAxiosParamCreator, i as ActivitiesApiFactory, a as ActivitiesApiFp, o as ApplicationsApi, s as ApplicationsApiAxiosParamCreator, c as ApplicationsApiFactory, l as ApplicationsApiFp, u as BucketDefinitionSortByEnum, t as Configuration, d as CreateChildDriveItemAtLibreGraphConflictBehaviorEnum, f as CreateChildDriveItemAtLibreGraphMissingParentsBehaviorEnum, p as CreateDriveItemAtLibreGraphConflictBehaviorEnum, m as CreateDriveItemAtLibreGraphMissingParentsBehaviorEnum, h as DriveItemApi, g as DriveItemApiAxiosParamCreator, _ as DriveItemApiFactory, v as DriveItemApiFp, y as DriveItemAtLibreGraphShareTypesEnum, b as DrivesApi, x as DrivesApiAxiosParamCreator, S as DrivesApiFactory, C as DrivesApiFp, w as DrivesGetDrivesApi, T as DrivesGetDrivesApiAxiosParamCreator, E as DrivesGetDrivesApiFactory, D as DrivesGetDrivesApiFp, O as DrivesPermissionsApi, k as DrivesPermissionsApiAxiosParamCreator, A as DrivesPermissionsApiFactory, j as DrivesPermissionsApiFp, M as DrivesRootApi, N as DrivesRootApiAxiosParamCreator, P as DrivesRootApiFactory, F as DrivesRootApiFp, I as EducationClassApi, L as EducationClassApiAxiosParamCreator, R as EducationClassApiFactory, z as EducationClassApiFp, B as EducationClassClassificationEnum, V as EducationClassTeachersApi, H as EducationClassTeachersApiAxiosParamCreator, U as EducationClassTeachersApiFactory, W as EducationClassTeachersApiFp, G as EducationSchoolApi, K as EducationSchoolApiAxiosParamCreator, q as EducationSchoolApiFactory, J as EducationSchoolApiFp, Y as EducationUserApi, X as EducationUserApiAxiosParamCreator, Z as EducationUserApiFactory, Q as EducationUserApiFp, $ as GetDriveItemChildrenSelectEnum, et as GetDriveItemExpandEnum, tt as GetDriveItemSelectEnum, nt as GetDriveItemV1ExpandEnum, rt as GetDriveItemV1SelectEnum, it as GetDriveSelectEnum, at as GetEducationUserExpandEnum, ot as GetGroupExpandEnum, st as GetGroupSelectEnum, ct as GetOwnUserExpandEnum, lt as GetRootExpandEnum, ut as GetRootSelectEnum, dt as GetUserExpandEnum, ft as GetUserSelectEnum, pt as GroupApi, mt as GroupApiAxiosParamCreator, ht as GroupApiFactory, gt as GroupApiFp, _t as GroupsApi, vt as GroupsApiAxiosParamCreator, yt as GroupsApiFactory, bt as GroupsApiFp, xt as GuestLinkErrorErrorTypeEnum, St as GuestLinksApi, Ct as GuestLinksApiAxiosParamCreator, wt as GuestLinksApiFactory, Tt as GuestLinksApiFp, Et as HomeGetChildrenSelectEnum, Dt as HomeGetRootExpandEnum, Ot as HomeGetRootSelectEnum, kt as InvitationsApi, At as InvitationsApiAxiosParamCreator, jt as InvitationsApiFactory, Mt as InvitationsApiFp, Nt as ListAllDrivesBetaSelectEnum, Pt as ListEducationUsersExpandEnum, Ft as ListEducationUsersOrderbyEnum, It as ListGroupsExpandEnum, Lt as ListGroupsOrderbyEnum, Rt as ListGroupsSelectEnum, zt as ListMyDrivesBetaSelectEnum, Bt as ListPermissionsSelectEnum, Vt as ListPermissionsSpaceRootSelectEnum, Ht as ListSharedByMeExpandEnum, Ut as ListSharedWithMeExpandEnum, Wt as ListUsersExpandEnum, Gt as ListUsersOrderbyEnum, Kt as ListUsersSelectEnum, qt as LockInfoLockTypeEnum, Jt as MeChangepasswordApi, Yt as MeChangepasswordApiAxiosParamCreator, Xt as MeChangepasswordApiFactory, Zt as MeChangepasswordApiFp, Qt as MeDriveApi, $t as MeDriveApiAxiosParamCreator, en as MeDriveApiFactory, tn as MeDriveApiFp, nn as MeDriveRootApi, rn as MeDriveRootApiAxiosParamCreator, in as MeDriveRootApiFactory, an as MeDriveRootApiFp, on as MeDriveRootChildrenApi, sn as MeDriveRootChildrenApiAxiosParamCreator, cn as MeDriveRootChildrenApiFactory, ln as MeDriveRootChildrenApiFp, un as MeDrivesApi, dn as MeDrivesApiAxiosParamCreator, fn as MeDrivesApiFactory, pn as MeDrivesApiFp, mn as MePhotoApi, hn as MePhotoApiAxiosParamCreator, gn as MePhotoApiFactory, _n as MePhotoApiFp, vn as MeUserApi, yn as MeUserApiAxiosParamCreator, bn as MeUserApiFactory, xn as MeUserApiFp, Sn as MetricDefinitionKindEnum, Cn as RoleManagementApi, wn as RoleManagementApiAxiosParamCreator, Tn as RoleManagementApiFactory, En as RoleManagementApiFp, Dn as SearchApi, On as SearchApiAxiosParamCreator, kn as SearchApiFactory, An as SearchApiFp, jn as SearchMetricKindEnum, Mn as SearchQueryExpandEnum, Nn as SearchRequestEntityTypesEnum, Pn as SharingLinkType, Fn as TagsApi, In as TagsApiAxiosParamCreator, Ln as TagsApiFactory, Rn as TagsApiFp, zn as UserApi, Bn as UserApiAxiosParamCreator, Vn as UserApiFactory, Hn as UserApiFp, Un as UserAppRoleAssignmentApi, Wn as UserAppRoleAssignmentApiAxiosParamCreator, Gn as UserAppRoleAssignmentApiFactory, Kn as UserAppRoleAssignmentApiFp, qn as UserPhotoApi, Jn as UserPhotoApiAxiosParamCreator, Yn as UserPhotoApiFactory, Xn as UserPhotoApiFp, Zn as UserTeamworkApi, Qn as UserTeamworkApiAxiosParamCreator, $n as UserTeamworkApiFactory, er as UserTeamworkApiFp, tr as UsersApi, nr as UsersApiAxiosParamCreator, rr as UsersApiFactory, ir as UsersApiFp } from "../../generated-4nR8KA38.js";
|
package/dist/web-client/graph.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as graph };
|
|
1
|
+
export { t as graph } from "../graph-CwVan2Jp.js";
|
package/dist/web-client/ocs.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as GetCapabilitiesFactory, t as ocs };
|
|
1
|
+
export { o as GetCapabilitiesFactory, t as ocs } from "../ocs-Dfdjrujs.js";
|
package/dist/web-client/ox.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "../urlJoin-_pUL1TUx.js";
|
|
2
|
-
import { a as t, i as n, n as r, o as i, r as a, t as o } from "../schemas-
|
|
2
|
+
import { a as t, i as n, n as r, o as i, r as a, t as o } from "../schemas-rdabTCJb.js";
|
|
3
3
|
//#region src/ox/types.ts
|
|
4
4
|
var s = n({
|
|
5
5
|
id: t(),
|
package/dist/web-client/sse.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, i as t, n } from "../schemas-
|
|
1
|
+
import { a as e, i as t, n } from "../schemas-rdabTCJb.js";
|
|
2
2
|
//#region ../../node_modules/.pnpm/@microsoft+fetch-event-source@2.0.1/node_modules/@microsoft/fetch-event-source/lib/esm/parse.js
|
|
3
3
|
async function r(e, t) {
|
|
4
4
|
let n = e.getReader(), r;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as e } from "../webdav-
|
|
2
|
-
import { G as t, K as n, U as r, W as i, q as a } from "../helpers-
|
|
1
|
+
import { t as e } from "../webdav-DrQsSfxZ.js";
|
|
2
|
+
import { G as t, K as n, U as r, W as i, q as a } from "../helpers-Bh5xR_vg.js";
|
|
3
3
|
export { r as DavMethod, i as DavNamespaces, t as DavPermission, n as DavProperties, a as DavProperty, e as webdav };
|
package/dist/web-client.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as e } from "./graph-
|
|
2
|
-
import { i as t, n, r, t as i } from "./webdav-
|
|
1
|
+
import { t as e } from "./graph-CwVan2Jp.js";
|
|
2
|
+
import { i as t, n, r, t as i } from "./webdav-DrQsSfxZ.js";
|
|
3
3
|
import { t as a } from "./urlJoin-_pUL1TUx.js";
|
|
4
|
-
import { A as o, B as s, C as c, D as l, E as u, F as d, H as f, I as p, J as m, L as h, M as g, N as _, O as v, P as y, R as b, S as x, T as S, V as C, Y as w, _ as T, a as E, b as D, c as O, d as k, f as A, g as j, h as M, i as N, j as P, k as F, l as I, m as L, n as R, o as z, p as B, r as V, s as H, t as U, u as W, v as G, w as K, x as q, y as J, z as Y } from "./helpers-
|
|
5
|
-
import { t as X } from "./ocs-
|
|
4
|
+
import { A as o, B as s, C as c, D as l, E as u, F as d, H as f, I as p, J as m, L as h, M as g, N as _, O as v, P as y, R as b, S as x, T as S, V as C, Y as w, _ as T, a as E, b as D, c as O, d as k, f as A, g as j, h as M, i as N, j as P, k as F, l as I, m as L, n as R, o as z, p as B, r as V, s as H, t as U, u as W, v as G, w as K, x as q, y as J, z as Y } from "./helpers-Bh5xR_vg.js";
|
|
5
|
+
import { t as X } from "./ocs-Dfdjrujs.js";
|
|
6
6
|
import { ox as Z } from "./web-client/ox.js";
|
|
7
7
|
//#region src/helpers/call.ts
|
|
8
8
|
var Q = function* (e) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./axios-
|
|
2
|
-
import { t as r } from "./dist-
|
|
1
|
+
import { n as e, r as t, t as n } from "./axios-DRPhbClr.js";
|
|
2
|
+
import { t as r } from "./dist-CHy-DaIN.js";
|
|
3
3
|
import { t as i } from "./urlJoin-_pUL1TUx.js";
|
|
4
|
-
import { E as a, K as o, M as s, N as c, U as l, W as u, _ as d, f, q as p } from "./helpers-
|
|
5
|
-
import { a as m, i as h, n as g, r as _, t as v } from "./ocs-
|
|
4
|
+
import { E as a, K as o, M as s, N as c, U as l, W as u, _ as d, f, q as p } from "./helpers-Bh5xR_vg.js";
|
|
5
|
+
import { a as m, i as h, n as g, r as _, t as v } from "./ocs-Dfdjrujs.js";
|
|
6
6
|
//#region src/utils/encodePath.ts
|
|
7
7
|
var y = (e) => encodeURIComponent(e).split("%2F").join("/"), b = class extends Error {
|
|
8
8
|
response;
|
|
@@ -12,8 +12,9 @@ var y = (e) => encodeURIComponent(e).split("%2F").join("/"), b = class extends E
|
|
|
12
12
|
}
|
|
13
13
|
}, x = class extends b {
|
|
14
14
|
errorCode;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
errorType;
|
|
16
|
+
constructor(e, t, n, r = null, i) {
|
|
17
|
+
super(e, n, r), this.errorCode = t, this.errorType = i;
|
|
17
18
|
}
|
|
18
19
|
};
|
|
19
20
|
//#endregion
|
|
@@ -521,73 +522,75 @@ var ve = D, O = (e, { fileId: t, path: n, name: r }) => {
|
|
|
521
522
|
}
|
|
522
523
|
}), we = (e, t) => ({ getPublicFileUrl(t, n) {
|
|
523
524
|
return e.getFileUrl(i("public-files", n));
|
|
524
|
-
} }), Te = (e, t, n) => ({ async listFiles(
|
|
525
|
-
let
|
|
526
|
-
if (a(
|
|
527
|
-
|
|
528
|
-
depth:
|
|
529
|
-
properties:
|
|
530
|
-
extraProps:
|
|
531
|
-
...
|
|
532
|
-
}),
|
|
525
|
+
} }), Te = (e, t, n) => ({ async listFiles(r, { path: l, fileId: u } = {}, { depth: m = 1, davProperties: h, extraProps: g = [], isTrash: _ = !1, ...v } = {}) {
|
|
526
|
+
let y = [...e.extraProps, ...g], b;
|
|
527
|
+
if (a(r)) {
|
|
528
|
+
b = await e.propfind(i(r.webDavPath, l), {
|
|
529
|
+
depth: m,
|
|
530
|
+
properties: h || o.PublicLink,
|
|
531
|
+
extraProps: g,
|
|
532
|
+
...v
|
|
533
|
+
}), b.forEach((e) => {
|
|
533
534
|
e.filename = e.filename.split("/").slice(1).join("/");
|
|
534
|
-
}),
|
|
535
|
+
}), b.length === 1 && (b[0].filename = i(r.id, l, { leadingSlash: !0 })), b.forEach((e) => {
|
|
535
536
|
e.filename = e.filename.split("/").slice(2).join("/");
|
|
536
537
|
});
|
|
537
|
-
let t =
|
|
538
|
-
if ((!
|
|
539
|
-
basename:
|
|
538
|
+
let t = r.driveAlias.startsWith("ocm/") ? "ocm" : "public-link";
|
|
539
|
+
if ((!l || l === "/") && m > 0 && t === "ocm" && b[0].props[p.PublicLinkItemType] === "file" && (b = [{
|
|
540
|
+
basename: r.fileId,
|
|
540
541
|
type: "directory",
|
|
541
542
|
filename: "",
|
|
542
543
|
props: {}
|
|
543
|
-
}, ...
|
|
544
|
-
let [e, ...
|
|
544
|
+
}, ...b]), !l) {
|
|
545
|
+
let [e, ...i] = b;
|
|
545
546
|
return {
|
|
546
547
|
resource: f({
|
|
547
548
|
...e,
|
|
548
|
-
id:
|
|
549
|
-
driveAlias:
|
|
550
|
-
webDavPath:
|
|
549
|
+
id: r.id,
|
|
550
|
+
driveAlias: r.driveAlias,
|
|
551
|
+
webDavPath: r.webDavPath,
|
|
552
|
+
serverUrl: n.baseUrl,
|
|
551
553
|
publicLinkType: t
|
|
552
554
|
}),
|
|
553
|
-
children:
|
|
555
|
+
children: i.map((e) => c(e, y))
|
|
554
556
|
};
|
|
555
557
|
}
|
|
556
|
-
let a =
|
|
558
|
+
let a = b.map((e) => c(e, y));
|
|
557
559
|
return {
|
|
558
560
|
resource: a[0],
|
|
559
561
|
children: a.slice(1)
|
|
560
562
|
};
|
|
561
563
|
}
|
|
562
|
-
let
|
|
563
|
-
let e = await t.getPathForFileId(
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
564
|
+
let S = async () => {
|
|
565
|
+
let e = await t.getPathForFileId(u);
|
|
566
|
+
if (!e) throw new x("Resource not found", void 0, void 0, 404);
|
|
567
|
+
return this.listFiles(r, { path: e }, {
|
|
568
|
+
depth: m,
|
|
569
|
+
davProperties: h,
|
|
570
|
+
extraProps: g
|
|
568
571
|
});
|
|
569
572
|
};
|
|
570
573
|
try {
|
|
571
574
|
let t = "";
|
|
572
|
-
if (t =
|
|
573
|
-
fileId:
|
|
574
|
-
path:
|
|
575
|
-
}),
|
|
576
|
-
depth:
|
|
577
|
-
properties:
|
|
578
|
-
extraProps:
|
|
579
|
-
...
|
|
580
|
-
}),
|
|
581
|
-
resource: c(
|
|
582
|
-
children:
|
|
575
|
+
if (t = _ ? d(r.id) : O(r, {
|
|
576
|
+
fileId: u,
|
|
577
|
+
path: l
|
|
578
|
+
}), b = await e.propfind(t, {
|
|
579
|
+
depth: m,
|
|
580
|
+
properties: h || o.Default,
|
|
581
|
+
extraProps: g,
|
|
582
|
+
...v
|
|
583
|
+
}), _) return {
|
|
584
|
+
resource: c(b[0], y),
|
|
585
|
+
children: b.slice(1).map(s)
|
|
583
586
|
};
|
|
584
|
-
let
|
|
585
|
-
return
|
|
586
|
-
resource:
|
|
587
|
-
children:
|
|
587
|
+
let n = b.map((e) => c(e, y)), i = u === r.id;
|
|
588
|
+
return u && !i && n[0].fileId && u !== n[0].fileId ? S() : {
|
|
589
|
+
resource: n[0],
|
|
590
|
+
children: n.slice(1)
|
|
588
591
|
};
|
|
589
592
|
} catch (e) {
|
|
590
|
-
if (e.statusCode === 404 &&
|
|
593
|
+
if (e.statusCode === 404 && u) return S();
|
|
591
594
|
throw e;
|
|
592
595
|
}
|
|
593
596
|
} }), Ee = (e, t) => ({ moveFiles(t, { path: n, fileId: r }, i, { path: a, parentFolderId: o, name: s }, { overwrite: c, ...l } = {}) {
|
|
@@ -6139,20 +6142,20 @@ function Ba(e, t = {}) {
|
|
|
6139
6142
|
};
|
|
6140
6143
|
}
|
|
6141
6144
|
//#endregion
|
|
6142
|
-
//#region ../../node_modules/.pnpm/uuid@14.0.
|
|
6145
|
+
//#region ../../node_modules/.pnpm/uuid@14.0.3/node_modules/uuid/dist/stringify.js
|
|
6143
6146
|
var $ = [];
|
|
6144
6147
|
for (let e = 0; e < 256; ++e) $.push((e + 256).toString(16).slice(1));
|
|
6145
6148
|
function Va(e, t = 0) {
|
|
6146
6149
|
return ($[e[t + 0]] + $[e[t + 1]] + $[e[t + 2]] + $[e[t + 3]] + "-" + $[e[t + 4]] + $[e[t + 5]] + "-" + $[e[t + 6]] + $[e[t + 7]] + "-" + $[e[t + 8]] + $[e[t + 9]] + "-" + $[e[t + 10]] + $[e[t + 11]] + $[e[t + 12]] + $[e[t + 13]] + $[e[t + 14]] + $[e[t + 15]]).toLowerCase();
|
|
6147
6150
|
}
|
|
6148
6151
|
//#endregion
|
|
6149
|
-
//#region ../../node_modules/.pnpm/uuid@14.0.
|
|
6152
|
+
//#region ../../node_modules/.pnpm/uuid@14.0.3/node_modules/uuid/dist/rng.js
|
|
6150
6153
|
var Ha = /* @__PURE__ */ new Uint8Array(16);
|
|
6151
6154
|
function Ua() {
|
|
6152
6155
|
return crypto.getRandomValues(Ha);
|
|
6153
6156
|
}
|
|
6154
6157
|
//#endregion
|
|
6155
|
-
//#region ../../node_modules/.pnpm/uuid@14.0.
|
|
6158
|
+
//#region ../../node_modules/.pnpm/uuid@14.0.3/node_modules/uuid/dist/v4.js
|
|
6156
6159
|
function Wa(e, t, n) {
|
|
6157
6160
|
return !t && !e && crypto.randomUUID ? crypto.randomUUID() : Ga(e, t, n);
|
|
6158
6161
|
}
|
|
@@ -6237,7 +6240,8 @@ var Qa = async (e) => {
|
|
|
6237
6240
|
}, $a = (e) => {
|
|
6238
6241
|
let t = new g(), n = {
|
|
6239
6242
|
message: "Unknown error",
|
|
6240
|
-
errorCode: void 0
|
|
6243
|
+
errorCode: void 0,
|
|
6244
|
+
errorType: void 0
|
|
6241
6245
|
};
|
|
6242
6246
|
try {
|
|
6243
6247
|
let r = t.parse(e);
|
|
@@ -6250,6 +6254,8 @@ var Qa = async (e) => {
|
|
|
6250
6254
|
let e = r["d:error"]["s:errorcode"];
|
|
6251
6255
|
typeof e == "string" && (n.errorCode = e);
|
|
6252
6256
|
}
|
|
6257
|
+
let i = r["d:error"]["opencloud:details"]?.["opencloud:error_type"];
|
|
6258
|
+
typeof i == "string" && (n.errorType = i);
|
|
6253
6259
|
} catch {
|
|
6254
6260
|
return n;
|
|
6255
6261
|
}
|
|
@@ -6258,9 +6264,10 @@ var Qa = async (e) => {
|
|
|
6258
6264
|
client;
|
|
6259
6265
|
davPath;
|
|
6260
6266
|
headers;
|
|
6267
|
+
withCredentials;
|
|
6261
6268
|
extraProps;
|
|
6262
|
-
constructor({ baseUrl: e, headers: t }) {
|
|
6263
|
-
this.davPath = i(e, "dav"), this.client = Ba(this.davPath, {}), this.headers = t, this.extraProps = [];
|
|
6269
|
+
constructor({ baseUrl: e, headers: t, withCredentials: n }) {
|
|
6270
|
+
this.davPath = i(e, "dav"), this.client = Ba(this.davPath, {}), this.headers = t, this.withCredentials = n, this.extraProps = [];
|
|
6264
6271
|
}
|
|
6265
6272
|
mkcol(e, t = {}) {
|
|
6266
6273
|
return this.request(e, {
|
|
@@ -6360,7 +6367,8 @@ var Qa = async (e) => {
|
|
|
6360
6367
|
let n = i(this.davPath, y(e), { leadingSlash: !0 }), r = {
|
|
6361
6368
|
...t,
|
|
6362
6369
|
url: n,
|
|
6363
|
-
headers: this.buildHeaders(t.headers || {})
|
|
6370
|
+
headers: this.buildHeaders(t.headers || {}),
|
|
6371
|
+
...this.withCredentials?.() && { withCredentials: !0 }
|
|
6364
6372
|
};
|
|
6365
6373
|
try {
|
|
6366
6374
|
let e = await this.client.customRequest("", r), t;
|
|
@@ -6371,7 +6379,7 @@ var Qa = async (e) => {
|
|
|
6371
6379
|
};
|
|
6372
6380
|
} catch (e) {
|
|
6373
6381
|
let { response: t } = e, n = $a(await t.text());
|
|
6374
|
-
throw new x(n.message, n.errorCode, t, t.status);
|
|
6382
|
+
throw new x(n.message, n.errorCode, t, t.status, n.errorType);
|
|
6375
6383
|
}
|
|
6376
6384
|
}
|
|
6377
6385
|
}, to = (e, t) => ({ async listFileVersions(t, n = {}) {
|
|
@@ -6382,40 +6390,41 @@ var Qa = async (e) => {
|
|
|
6382
6390
|
return e.propPatch(i(t.webDavPath, n), o, a);
|
|
6383
6391
|
} }), ro = (e, t) => ({ setProperties(t, { path: n }, r, a = {}) {
|
|
6384
6392
|
return e.propPatch(i(t.webDavPath, n), r, a);
|
|
6385
|
-
} }), io = (e, t) => {
|
|
6386
|
-
let
|
|
6387
|
-
t &&
|
|
6388
|
-
let
|
|
6389
|
-
axiosClient:
|
|
6393
|
+
} }), io = (e, t, r) => {
|
|
6394
|
+
let i = n.create();
|
|
6395
|
+
(t || r) && i.interceptors.request.use((e) => (t && Object.assign(e.headers, t()), r?.() && (e.withCredentials = !0), e));
|
|
6396
|
+
let a = {
|
|
6397
|
+
axiosClient: i,
|
|
6390
6398
|
baseUrl: e,
|
|
6391
6399
|
headers: t
|
|
6392
|
-
},
|
|
6400
|
+
}, o = new eo({
|
|
6393
6401
|
baseUrl: e,
|
|
6394
|
-
headers: t
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6402
|
+
headers: t,
|
|
6403
|
+
withCredentials: r
|
|
6404
|
+
}), s = (e) => {
|
|
6405
|
+
o.extraProps.push(e);
|
|
6406
|
+
}, c = Ne(o, a), { getPathForFileId: l } = c, u = Te(o, c, a), { listFiles: d } = u, f = Se(u, a), { getFileInfo: p } = f, { createFolder: m } = be(o, f, a), h = xe(o, a), { getFileContents: g } = h, { putFileContents: _ } = De(o, f, a), { getFileUrl: v, revokeUrl: y } = Ce(o, h, f, a), { getPublicFileUrl: b } = we(o, a), { copyFiles: x } = ye(o, a), { moveFiles: S } = Ee(o, a), { deleteFile: C } = Oe(o, a), { restoreFile: ee } = ke(o, a), { listFileVersions: w } = to(o, a), { restoreFileVersion: te } = Ae(o, a), { clearTrashBin: T } = je(o, a), { search: E } = Me(o, a), { setFavorite: ne } = no(o, a), { setProperties: re } = ro(o, a);
|
|
6398
6407
|
return {
|
|
6399
|
-
copyFiles:
|
|
6400
|
-
createFolder:
|
|
6401
|
-
deleteFile:
|
|
6402
|
-
restoreFile:
|
|
6403
|
-
restoreFileVersion:
|
|
6404
|
-
getFileContents:
|
|
6405
|
-
getFileInfo:
|
|
6406
|
-
getFileUrl:
|
|
6407
|
-
getPublicFileUrl:
|
|
6408
|
-
getPathForFileId:
|
|
6409
|
-
listFiles:
|
|
6410
|
-
listFileVersions:
|
|
6411
|
-
moveFiles:
|
|
6412
|
-
putFileContents:
|
|
6413
|
-
revokeUrl:
|
|
6414
|
-
clearTrashBin:
|
|
6415
|
-
search:
|
|
6416
|
-
setFavorite:
|
|
6417
|
-
setProperties:
|
|
6418
|
-
registerExtraProp:
|
|
6408
|
+
copyFiles: x,
|
|
6409
|
+
createFolder: m,
|
|
6410
|
+
deleteFile: C,
|
|
6411
|
+
restoreFile: ee,
|
|
6412
|
+
restoreFileVersion: te,
|
|
6413
|
+
getFileContents: g,
|
|
6414
|
+
getFileInfo: p,
|
|
6415
|
+
getFileUrl: v,
|
|
6416
|
+
getPublicFileUrl: b,
|
|
6417
|
+
getPathForFileId: l,
|
|
6418
|
+
listFiles: d,
|
|
6419
|
+
listFileVersions: w,
|
|
6420
|
+
moveFiles: S,
|
|
6421
|
+
putFileContents: _,
|
|
6422
|
+
revokeUrl: y,
|
|
6423
|
+
clearTrashBin: T,
|
|
6424
|
+
search: E,
|
|
6425
|
+
setFavorite: ne,
|
|
6426
|
+
setProperties: re,
|
|
6427
|
+
registerExtraProp: s
|
|
6419
6428
|
};
|
|
6420
6429
|
};
|
|
6421
6430
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencloud-eu/web-client",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"description": "OpenCloud web client",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"private": false,
|
|
@@ -54,13 +54,11 @@
|
|
|
54
54
|
"axios": "^1.13.6",
|
|
55
55
|
"fast-xml-parser": "^5.5.9",
|
|
56
56
|
"lodash-es": "^4.17.23",
|
|
57
|
-
"luxon": "^3.7.2",
|
|
58
57
|
"uuid": "^14.0.0",
|
|
59
58
|
"webdav": "5.11.0",
|
|
60
59
|
"zod": "^4.3.6"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
|
-
"@types/luxon": "3.7.6",
|
|
64
62
|
"@types/node": "^25.5.0",
|
|
65
63
|
"vite": "^8.0.3",
|
|
66
64
|
"vite-plugin-node-polyfills": "0.28.0"
|