box-ui-elements
Version:
Box UI Elements
22 lines (21 loc) • 1.16 kB
TypeScript
export interface ConvertSharedLinkSettingsReturnType {
password?: string | null;
permissions?: {
can_download?: boolean;
can_preview: boolean;
};
unshared_at: string | null;
vanity_url: string;
}
export declare const convertSharedLinkPermissions: (permissionLevel: string) => {
[x: number]: boolean;
};
/**
* Convert a shared link settings object from the USM into the format that the API expects.
* This function compares the provided access level to both API and internal USM access level constants, to accommodate two potential flows:
* - Changing the settings for a shared link right after the shared link has been created. The access level is saved directly from the data
* returned by the API, so it is in API format.
* - Changing the settings for a shared link in any other scenario. The access level is saved from the initial calls to the Item API and
* convertItemResponse, so it is in internal USM format.
*/
export declare const convertSharedLinkSettings: (newSettings: SharedLinkSettings, accessLevel: string, isDownloadAvailable: boolean, serverUrl: string) => ConvertSharedLinkSettingsReturnType;