@opencloud-eu/web-client 7.1.2 → 7.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.
@@ -403,10 +403,15 @@ export interface DriveItem {
403
403
  'permissions'?: Array<Permission>;
404
404
  'audio'?: Audio;
405
405
  'video'?: Video;
406
+ '@libre.graph.motionPhoto'?: MotionPhoto;
406
407
  /**
407
408
  * Indicates if the item is synchronized with the underlying storage provider. Read-only.
408
409
  */
409
410
  '@client.synchronize'?: boolean;
411
+ /**
412
+ * A pre-authenticated URL that can be used to download the item\'s content without providing an Authorization header. The URL is short-lived and cannot be cached. This annotation is only populated when explicitly requested via `$select`, and only for items that have a `file` facet. The returned URL is valid for a limited time and should be used promptly.
413
+ */
414
+ '@microsoft.graph.downloadUrl'?: string;
410
415
  /**
411
416
  * Properties or facets (see UI.Facet) annotated with this term will not be rendered if the annotation evaluates to true. Users can set this to hide permissions.
412
417
  */
@@ -886,6 +891,23 @@ export interface ItemReference {
886
891
  export interface MemberReference {
887
892
  '@odata.id'?: string;
888
893
  }
894
+ /**
895
+ * Motion Photo metadata. A Motion Photo is a still image with a short video clip appended to the end of the file. The presence of this facet on a driveItem indicates that the item is a Motion Photo; absence indicates it is not. Based on the Google Motion Photo format v1.0 specification: https://developer.android.com/media/platform/motion-photo-format
896
+ */
897
+ export interface MotionPhoto {
898
+ /**
899
+ * The file format version of the Motion Photo. Currently always 1. Read-only.
900
+ */
901
+ 'version'?: number;
902
+ /**
903
+ * Presentation timestamp in microseconds of the video frame that corresponds to the still image. A value of -1 indicates unspecified. If absent, readers should use a timestamp near the middle of the video track. Read-only.
904
+ */
905
+ 'presentationTimestampUs'?: number;
906
+ /**
907
+ * Size in bytes of the embedded video portion of the file. The video is appended at the end of the file, so clients can fetch it with a Range request: `Range: bytes=<fileSize - videoSize>-`. Read-only.
908
+ */
909
+ 'videoSize'?: number;
910
+ }
889
911
  /**
890
912
  * Represents an identity used to sign in to a user account
891
913
  */
@@ -1599,10 +1621,20 @@ export declare const DriveItemApiAxiosParamCreator: (configuration?: Configurati
1599
1621
  * @summary Get a DriveItem.
1600
1622
  * @param {string} driveId key: id of drive
1601
1623
  * @param {string} itemId key: id of item
1624
+ * @param {Set<GetDriveItemSelectEnum>} [$select] Select additional properties to be returned.
1602
1625
  * @param {*} [options] Override http request option.
1603
1626
  * @throws {RequiredError}
1604
1627
  */
1605
- getDriveItem: (driveId: string, itemId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1628
+ getDriveItem: (driveId: string, itemId: string, $select?: Set<GetDriveItemSelectEnum>, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1629
+ /**
1630
+ * Download the contents of the primary stream (file) of a driveItem. Only driveItem objects with a `file` facet can be downloaded. The response is a `302 Found` redirecting to a pre-authenticated download URL for the file. This is the same URL that is returned via the `@microsoft.graph.downloadUrl` instance annotation on the driveItem when requested via `$select`. Choose between the two based on whether you want to call the redirecting `/content` endpoint directly (for example, with a client that follows redirects automatically) or you want to inspect / schedule / prefetch the URL yourself via the annotation. The pre-authenticated URL is short-lived and does not require an `Authorization` header. To download a partial range of bytes, apply the `Range` header to the redirect target (the pre-authenticated URL), not to the `/content` request.
1631
+ * @summary Download the content of a DriveItem
1632
+ * @param {string} driveId key: id of drive
1633
+ * @param {string} itemId key: id of item
1634
+ * @param {*} [options] Override http request option.
1635
+ * @throws {RequiredError}
1636
+ */
1637
+ getDriveItemContent: (driveId: string, itemId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1606
1638
  /**
1607
1639
  * Update a DriveItem. The request body must include a JSON object with the properties to update. Only the properties that are provided will be updated. Currently it supports updating the following properties: * `@UI.Hidden` - Hides the item from the UI.
1608
1640
  * @summary Update a DriveItem.
@@ -1632,10 +1664,20 @@ export declare const DriveItemApiFp: (configuration?: Configuration) => {
1632
1664
  * @summary Get a DriveItem.
1633
1665
  * @param {string} driveId key: id of drive
1634
1666
  * @param {string} itemId key: id of item
1667
+ * @param {Set<GetDriveItemSelectEnum>} [$select] Select additional properties to be returned.
1668
+ * @param {*} [options] Override http request option.
1669
+ * @throws {RequiredError}
1670
+ */
1671
+ getDriveItem(driveId: string, itemId: string, $select?: Set<GetDriveItemSelectEnum>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DriveItem>>;
1672
+ /**
1673
+ * Download the contents of the primary stream (file) of a driveItem. Only driveItem objects with a `file` facet can be downloaded. The response is a `302 Found` redirecting to a pre-authenticated download URL for the file. This is the same URL that is returned via the `@microsoft.graph.downloadUrl` instance annotation on the driveItem when requested via `$select`. Choose between the two based on whether you want to call the redirecting `/content` endpoint directly (for example, with a client that follows redirects automatically) or you want to inspect / schedule / prefetch the URL yourself via the annotation. The pre-authenticated URL is short-lived and does not require an `Authorization` header. To download a partial range of bytes, apply the `Range` header to the redirect target (the pre-authenticated URL), not to the `/content` request.
1674
+ * @summary Download the content of a DriveItem
1675
+ * @param {string} driveId key: id of drive
1676
+ * @param {string} itemId key: id of item
1635
1677
  * @param {*} [options] Override http request option.
1636
1678
  * @throws {RequiredError}
1637
1679
  */
1638
- getDriveItem(driveId: string, itemId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DriveItem>>;
1680
+ getDriveItemContent(driveId: string, itemId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OdataError>>;
1639
1681
  /**
1640
1682
  * Update a DriveItem. The request body must include a JSON object with the properties to update. Only the properties that are provided will be updated. Currently it supports updating the following properties: * `@UI.Hidden` - Hides the item from the UI.
1641
1683
  * @summary Update a DriveItem.
@@ -1665,10 +1707,20 @@ export declare const DriveItemApiFactory: (configuration?: Configuration, basePa
1665
1707
  * @summary Get a DriveItem.
1666
1708
  * @param {string} driveId key: id of drive
1667
1709
  * @param {string} itemId key: id of item
1710
+ * @param {Set<GetDriveItemSelectEnum>} [$select] Select additional properties to be returned.
1711
+ * @param {*} [options] Override http request option.
1712
+ * @throws {RequiredError}
1713
+ */
1714
+ getDriveItem(driveId: string, itemId: string, $select?: Set<GetDriveItemSelectEnum>, options?: RawAxiosRequestConfig): AxiosPromise<DriveItem>;
1715
+ /**
1716
+ * Download the contents of the primary stream (file) of a driveItem. Only driveItem objects with a `file` facet can be downloaded. The response is a `302 Found` redirecting to a pre-authenticated download URL for the file. This is the same URL that is returned via the `@microsoft.graph.downloadUrl` instance annotation on the driveItem when requested via `$select`. Choose between the two based on whether you want to call the redirecting `/content` endpoint directly (for example, with a client that follows redirects automatically) or you want to inspect / schedule / prefetch the URL yourself via the annotation. The pre-authenticated URL is short-lived and does not require an `Authorization` header. To download a partial range of bytes, apply the `Range` header to the redirect target (the pre-authenticated URL), not to the `/content` request.
1717
+ * @summary Download the content of a DriveItem
1718
+ * @param {string} driveId key: id of drive
1719
+ * @param {string} itemId key: id of item
1668
1720
  * @param {*} [options] Override http request option.
1669
1721
  * @throws {RequiredError}
1670
1722
  */
1671
- getDriveItem(driveId: string, itemId: string, options?: RawAxiosRequestConfig): AxiosPromise<DriveItem>;
1723
+ getDriveItemContent(driveId: string, itemId: string, options?: RawAxiosRequestConfig): AxiosPromise<OdataError>;
1672
1724
  /**
1673
1725
  * Update a DriveItem. The request body must include a JSON object with the properties to update. Only the properties that are provided will be updated. Currently it supports updating the following properties: * `@UI.Hidden` - Hides the item from the UI.
1674
1726
  * @summary Update a DriveItem.
@@ -1698,10 +1750,20 @@ export declare class DriveItemApi extends BaseAPI {
1698
1750
  * @summary Get a DriveItem.
1699
1751
  * @param {string} driveId key: id of drive
1700
1752
  * @param {string} itemId key: id of item
1753
+ * @param {Set<GetDriveItemSelectEnum>} [$select] Select additional properties to be returned.
1701
1754
  * @param {*} [options] Override http request option.
1702
1755
  * @throws {RequiredError}
1703
1756
  */
1704
- getDriveItem(driveId: string, itemId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<DriveItem, any, {}>>;
1757
+ getDriveItem(driveId: string, itemId: string, $select?: Set<GetDriveItemSelectEnum>, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<DriveItem, any, {}>>;
1758
+ /**
1759
+ * Download the contents of the primary stream (file) of a driveItem. Only driveItem objects with a `file` facet can be downloaded. The response is a `302 Found` redirecting to a pre-authenticated download URL for the file. This is the same URL that is returned via the `@microsoft.graph.downloadUrl` instance annotation on the driveItem when requested via `$select`. Choose between the two based on whether you want to call the redirecting `/content` endpoint directly (for example, with a client that follows redirects automatically) or you want to inspect / schedule / prefetch the URL yourself via the annotation. The pre-authenticated URL is short-lived and does not require an `Authorization` header. To download a partial range of bytes, apply the `Range` header to the redirect target (the pre-authenticated URL), not to the `/content` request.
1760
+ * @summary Download the content of a DriveItem
1761
+ * @param {string} driveId key: id of drive
1762
+ * @param {string} itemId key: id of item
1763
+ * @param {*} [options] Override http request option.
1764
+ * @throws {RequiredError}
1765
+ */
1766
+ getDriveItemContent(driveId: string, itemId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<OdataError, any, {}>>;
1705
1767
  /**
1706
1768
  * Update a DriveItem. The request body must include a JSON object with the properties to update. Only the properties that are provided will be updated. Currently it supports updating the following properties: * `@UI.Hidden` - Hides the item from the UI.
1707
1769
  * @summary Update a DriveItem.
@@ -1713,6 +1775,10 @@ export declare class DriveItemApi extends BaseAPI {
1713
1775
  */
1714
1776
  updateDriveItem(driveId: string, itemId: string, driveItem: DriveItem, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<DriveItem, any, {}>>;
1715
1777
  }
1778
+ export declare const GetDriveItemSelectEnum: {
1779
+ readonly MicrosoftGraphDownloadUrl: "@microsoft.graph.downloadUrl";
1780
+ };
1781
+ export type GetDriveItemSelectEnum = typeof GetDriveItemSelectEnum[keyof typeof GetDriveItemSelectEnum];
1716
1782
  /**
1717
1783
  * DrivesApi - axios parameter creator
1718
1784
  */
@@ -41,6 +41,7 @@ export interface Resource {
41
41
  extraProps?: Record<string, unknown>;
42
42
  remoteItemId?: string;
43
43
  remoteItemPath?: string;
44
+ isInVault?: boolean;
44
45
  hasPreview?(): boolean;
45
46
  canCreate?(): boolean;
46
47
  canUpload?({ user }: {
@@ -60,6 +61,9 @@ export interface Resource {
60
61
  ability?: Ability;
61
62
  }): boolean;
62
63
  canEditTags?(): boolean;
64
+ canListVersions?(args?: {
65
+ user?: User;
66
+ }): boolean;
63
67
  getDomSelector?(): string;
64
68
  isReceivedShare?(): boolean;
65
69
  isShareRoot?(): boolean;
@@ -15,6 +15,7 @@ export declare abstract class ShareTypes {
15
15
  static readonly link: ShareType;
16
16
  static readonly guest: ShareType;
17
17
  static readonly remote: ShareType;
18
+ static readonly contact: ShareType;
18
19
  static readonly individuals: ShareType[];
19
20
  static readonly collectives: ShareType[];
20
21
  static readonly unauthenticated: ShareType[];
@@ -1,7 +1,7 @@
1
1
  import { Resource } from '../resource';
2
2
  import { PublicSpaceResource, ShareSpaceResource, SpaceResource } from './types';
3
3
  import { Drive } from '@opencloud-eu/web-client/graph/generated';
4
- import { CollaboratorShare, ShareRole } from '../share';
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;
@@ -11,11 +11,12 @@ export type PublicLinkType = 'ocm' | 'public-link';
11
11
  export declare function buildPublicSpaceResource(data: any & {
12
12
  publicLinkType: PublicLinkType;
13
13
  }): PublicSpaceResource;
14
- export declare function buildShareSpaceResource({ driveAliasPrefix, id, shareName, serverUrl }: {
14
+ export declare function buildShareSpaceResource({ driveAliasPrefix, id, shareName, serverUrl, graphPermissions }: {
15
15
  driveAliasPrefix: 'share' | 'ocm-share';
16
16
  id: string;
17
17
  shareName: string;
18
18
  serverUrl: string;
19
+ graphPermissions?: GraphSharePermission[];
19
20
  }): ShareSpaceResource;
20
21
  export declare function buildSpace(data: Drive & {
21
22
  path?: string;
@@ -39,9 +39,6 @@ export interface SpaceResource extends Resource {
39
39
  canRestoreFromTrashbin(args?: {
40
40
  user?: User;
41
41
  }): boolean;
42
- canListVersions(args?: {
43
- user?: User;
44
- }): boolean;
45
42
  getWebDavUrl({ path }: {
46
43
  path: string;
47
44
  }): string;
@@ -1,7 +1,8 @@
1
1
  import { graph } from './graph';
2
2
  import { ocs } from './ocs';
3
+ import { ox } from './ox';
3
4
  import { webdav } from './webdav';
4
5
  export * from './errors';
5
6
  export * from './helpers';
6
7
  export * from './utils';
7
- export { graph, ocs, webdav };
8
+ export { graph, ocs, ox, webdav };
@@ -0,0 +1,27 @@
1
+ import { AxiosInstance } from 'axios';
2
+ import { Contact } from './types';
3
+ export * from './types';
4
+ export interface OXMailRecipient {
5
+ name?: string;
6
+ email: string;
7
+ }
8
+ export interface OX {
9
+ autocompleteContacts(args: {
10
+ query: string;
11
+ signal?: AbortSignal;
12
+ }): Promise<Contact[]>;
13
+ sendMail(args: {
14
+ from: OXMailRecipient;
15
+ to: OXMailRecipient;
16
+ subject: string;
17
+ htmlContent: string;
18
+ signal?: AbortSignal;
19
+ }): Promise<void>;
20
+ }
21
+ /**
22
+ * Client for the Open-Xchange middleware HTTP API.
23
+ *
24
+ * The base url is resolved lazily through `getApiUrl` because it originates from
25
+ * a config option that is only available after the app has bootstrapped.
26
+ */
27
+ export declare const ox: (axiosClient: AxiosInstance, getApiUrl: () => string | undefined) => OX;
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * A contact as returned by the Open-Xchange addressbook autocomplete endpoint,
4
+ * normalized into a flat object.
5
+ */
6
+ export declare const ContactSchema: z.ZodObject<{
7
+ id: z.ZodString;
8
+ displayName: z.ZodString;
9
+ email: z.ZodString;
10
+ }, z.core.$strip>;
11
+ export type Contact = z.infer<typeof ContactSchema>;
12
+ /**
13
+ * Raw envelope of the Open-Xchange autocomplete response. `data` is a list of
14
+ * column-value arrays, ordered according to the requested `columns` parameter.
15
+ * @see https://documentation.open-xchange.com/components/middleware/http/8/index.html#!Addressbooks/doAutoCompleteContactsFromAddressbook
16
+ */
17
+ export declare const OxAutocompleteResponseSchema: z.ZodObject<{
18
+ data: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>>>;
19
+ }, z.core.$strip>;
20
+ /**
21
+ * Response of opening an Open-Xchange mail composition space. `data.id`
22
+ * identifies the space used for the subsequent send call.
23
+ * @see https://documentation.open-xchange.com/8.21/middleware/mail/mail_compose.html
24
+ */
25
+ export declare const OxComposeSpaceResponseSchema: z.ZodObject<{
26
+ data: z.ZodObject<{
27
+ id: z.ZodString;
28
+ }, z.core.$strip>;
29
+ }, z.core.$strip>;
@@ -12,6 +12,7 @@ export declare enum MESSAGE_TYPE {
12
12
  FOLDER_CREATED = "folder-created",
13
13
  SPACE_CREATED = "space-created",
14
14
  SPACE_DISABLED = "space-disabled",
15
+ SPACE_ENABLED = "space-enabled",
15
16
  SPACE_DELETED = "space-deleted",
16
17
  SPACE_MEMBER_ADDED = "space-member-added",
17
18
  SPACE_MEMBER_REMOVED = "space-member-removed",