UNPKG

@signiant/media-shuttle-sdk

Version:

The SDK for supporting file transfer to and from Media Shuttle

73 lines (72 loc) 5 kB
import Explorer, { AccountListResponse, FormDefinition, GetFolderContentRequest, Portal, PortalBasicRequest, PortalFile, PortalListRequest, PortalMetadataForms, PortalPermissions } from '../../external/navigation/Explorer'; import PlatformService, { GetFormDefinitionRequestOptions } from '../services/PlatformService'; export interface PlatformExplorerOptions { platformService: PlatformService; } export default class PlatformExplorer implements Explorer { private _platformService; constructor(options: PlatformExplorerOptions); private validMediaShuttleServices; /** * Lists all accounts a user has access to including the serviceId * @param {boolean} showExpired | allows the user to retrieve information about expired accounts * @returns {Promise<AccountListResponse>} */ listAccounts(showExpired?: boolean): Promise<AccountListResponse>; /** * This function returns a list of portals for a given account and service * @param {PortalListRequest} requestObject | request object * @param {string} requestObject.accountId | account identifier * @param {string} requestObject.serviceId | service identifier * @param {string} requestObject.showExpired | flag to include expired portals in the response * @param {string} requestObject.limitPortalsToMemberRole | get all portals the user making the request is MEMBER of. * @returns A list of portals */ listPortals({ accountId, serviceId, showExpired, limitPortalsToMemberRole, }: PortalListRequest): Promise<Portal[]>; /** * @ignore * It gets the contents of a portal folder. * @param {GetFolderContentRequest} - Request Object | Includes all the required parameters in order to perform the getFolderContent request * @param {GetFolderContentRequest} GetFolderContentRequest.accountId - **accountId**: The ID of the Account Containing the Media Shuttle Service. * @param {GetFolderContentRequest} GetFolderContentRequest.portalId - **portalId**: The ID of portal. * @param {GetFolderContentRequest} GetFolderContentRequest.serviceId - **serviceId**: The ID of the Media Shuttle Service. * @param {GetFolderContentRequest} GetFolderContentRequest.folderId - **folderId**: Folder Identifier (optional) if not send the home folder is assumed. * @param {GetFolderContentRequest} GetFolderContentRequest.browsePath - **browsePath**: path of the subfolder to look for relative to the provided folderId * @returns A list of files/folders in the folder. */ getFolderContent({ accountId, serviceId, portalId, folderId, browsePath, }: GetFolderContentRequest): Promise<PortalFile[]>; /** * It gets the permissions for a member of a portal. * @param {PortalBasicRequest} requestObject - Request Object | Includes all the required parameters in order to perform te getPortalMemberPermissions request * @param {string} requestObject.accountId - **accountId**: The ID of the Account Containing the Media Shuttle Service. * @param {string} requestObject.serviceId - **serviceId**: The ID of the Media Shuttle Service. * @param {string} requestObject.portalId - **portalId**: The ID of portal. * @returns The permissions for the portal member. */ getPortalMemberPermissions({ accountId, serviceId, portalId }: PortalBasicRequest): Promise<PortalPermissions>; /** * Fetches the metadata form definitions configured for the specified portal. * * Delegates to the underlying platform service to retrieve the portal's metadata forms. * * @param accountId - The identifier of the account that owns the portal. * @param serviceId - The identifier of the service under the account. * @param portalId - The unique identifier of the portal. * @returns A promise that resolves to the metadata form definition(s) associated with the portal. * @throws {Error} If the request fails, the portal is not found, or access is denied. */ getPortalMetadataForms({ accountId, serviceId, portalId }: PortalBasicRequest): Promise<PortalMetadataForms>; /** * Retrieves a form definition by its identifier for the specified account and service. * * This method delegates to the underlying platform service to fetch a single form definition resource. * * @param accountId - The unique identifier of the account that owns the service. * @param serviceId - The unique identifier of the service within the account. * @param formDefinitionId - The unique identifier of the form definition to retrieve. * @returns A promise that resolves to the requested form definition object. * @throws {Error} If the request fails due to network issues, authorization problems, or if the form definition cannot be found. */ getFormDefinitionById({ accountId, serviceId, formDefinitionId, }: GetFormDefinitionRequestOptions): Promise<FormDefinition>; } //# sourceMappingURL=PlatformExplorer.d.ts.map