import Base, { MaybeRaw } from "../../../Base"; import { EmailCooldown, Share, ShareCreate, SharePatch, ShareWithUsers } from "../../../interfaces/cosmo/share"; import { SearchFilter, Sorting } from "../../../interfaces/global"; /** * @class Share * @extends Base * * @remarks * **Under development, breaking changes possible** * * Represents a Share resource in Cosmo, providing methods to interact with the Share API. */ export declare class CosmoShare extends Base { protected getEndpoint(endpoint: string): string; /** * Create a new Share in the specified Organization and Space. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param createShare The Share object to create * * @returns The created Share */ createShare(orgName: string, spaceName: string, createShare: ShareCreate, raw?: { raw: R; }): Promise>; /** * Links the user to a Share, making the assets shared available to the user * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param shareId The ID of the Share to link * * @returns The created Share */ linkShare(orgName: string, spaceName: string, shareId: string, password?: string, shareIdHMAC?: string, raw?: { raw: R; }): Promise>; /** * Delete Shares by ID. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param shareIds The IDs of the Shares to delete * * @returns 204 No Content if successful */ deleteShare(orgName: string, spaceName: string, shareIds: string[], raw?: { raw: R; }): Promise>; /** * Fetch a Share. * @param orgName Name of the Organization * @param spaceName Name of the Space * @param shareId The ID of the Share to link * * @returns Detailed Share object */ fetchShare(orgName: string, spaceName: string, shareId: string, raw?: { raw: R; }): Promise>; /** * Searches for shares within a specific space in an organization. * * @param {string} orgName - The name of the organization. * @param {string} spaceName - The name of the space. * @param {{ sorting?: Sorting, filters?: SearchFilter[] }} search - Search criteria including optional sorting and filters. * @param {number} limit - Maximum number of results per page. * @param {number} page - The page number to retrieve. * @returns {Promise} A promise that resolves to a list of shares with their associated users. */ searchSharesOfSpace(orgName: string, spaceName: string, search: { sorting?: Sorting; filters?: SearchFilter[]; }, limit: number, page: number, raw?: { raw: R; }): Promise>; /** * Searches for shares the current user is linked to. * * @param {{ sorting?: Sorting, filters?: SearchFilter[] }} search - Search criteria including optional sorting and filters. * @param {number} limit - Maximum number of results per page. * @param {number} page - The page number to retrieve. * @returns {Promise} A promise that resolves to a list of shares the current user is linked to. */ searchSharesOfUser(search: { sorting?: Sorting; filters?: SearchFilter[]; }, limit: number, page: number, raw?: { raw: R; }): Promise>; /** * Unlinks the current user from a specific share in a space. * * @param {string} orgName - The name of the organization. * @param {string} spaceName - The name of the space. * @param {string} shareId - The ID of the share to unlink from. * @returns {Promise} A promise that resolves when the unlinking is complete. */ unlinkSelf(orgName: string, spaceName: string, shareId: string, raw?: { raw: R; }): Promise>; /** * Unlinks another user from a specific share in a space. * * @param {string} orgName - The name of the organization. * @param {string} spaceName - The name of the space. * @param {string} shareId - The ID of the share to unlink from. * @param {string} userId - The ID of the user to unlink. * @returns {Promise} A promise that resolves when the unlinking is complete. */ unlinkOther(orgName: string, spaceName: string, shareId: string, userId: string, raw?: { raw: R; }): Promise>; /** * Patch a Share in the specified Organization and Space. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param shareId ID of the Share * @param patchObject An object whose properties will be used to replace the existing Share ones * * @returns The patched Share */ patchShare(orgName: string, spaceName: string, shareId: string, patchObject: SharePatch, raw?: { raw: R; }): Promise>; /** * Resends share emails to **all recipients** associated with a share. * * This will trigger the backend to re-send the share notification email * to every email address that has previously been invited to the share. * * Returns `undefined` when all emails were sent (204), or an {@link EmailCooldown} * object when some recipients were skipped due to cooldown (200). * * @typeParam R - When `true`, the raw Axios response is returned instead of the parsed result * * @param orgName - The organization identifier * @param spaceName - The space identifier within the organization * @param shareId - The share ID whose emails should be resent * @param raw - Optional flag to return the raw Axios response * * @returns `EmailCooldown` when some emails were skipped, `undefined` when all were sent, * or the raw Axios response when `raw.raw` is `true` */ resendAllEmails(orgName: string, spaceName: string, shareId: string, raw?: { raw: R; }): Promise>; /** * Resends share emails to **specific recipients** for a share. * * Only the provided email addresses will receive a new share notification. * At least one email address must be provided. * * Returns `undefined` when all emails were sent (204), or an {@link EmailCooldown} * object when some recipients were skipped due to cooldown (200). * * @typeParam R - When `true`, the raw Axios response is returned instead of the parsed result * * @param orgName - The organization identifier * @param spaceName - The space identifier within the organization * @param shareId - The share ID whose emails should be resent * @param emails - A non-empty list of email addresses to resend the share to * @param raw - Optional flag to return the raw Axios response * * @returns `EmailCooldown` when some emails were skipped, `undefined` when all were sent, * or the raw Axios response when `raw.raw` is `true` */ resendEmails(orgName: string, spaceName: string, shareId: string, emails: [string, ...string[]], raw?: { raw: R; }): Promise>; /** * Sends a share email to a **specific recipient** after he clicks a public link. * * * @typeParam R - When `true`, the raw Axios response is returned instead of `undefined` * * @param orgName - The organization identifier * @param spaceName - The space identifier within the organization * @param shareId - The share ID whose emails should be resent * @param email - The email address of the recipient * @param shareIdHMAC - The HMAC of the share ID * @param raw - Optional flag to return the raw Axios response * * @returns `undefined` by default, or the raw Axios response when `raw.raw` is `true` */ sendShareEmailAfterPublicLinkClick(orgName: string, spaceName: string, shareId: string, email: string, shareIdHMAC: string, raw?: { raw: R; }): Promise>; }