UNPKG

@signiant/media-shuttle-sdk

Version:

The SDK for supporting file transfer to and from Media Shuttle

80 lines 3.41 kB
import { Download, Upload } from '@signiant/media-shuttle-sdk-base'; import Credentials from './common/Credentials'; import SDKOptions from './common/SDKOptions'; import Explorer from './navigation/Explorer'; import PlatformDownloadOptions from './transfer/PlatformDownloadOptions'; import PlatformUploadOptions from './transfer/PlatformUploadOptions'; /** * A factory class for generating resources to perform Media Shuttle actions. * * Create a factory instance as follows: * * @example * ``` * import { MediaShuttleResourceFactory, LoginCredentials, Explorer } from '@signiant/media-shuttle-sdk'; * const loginCredentials:LoginCredentials = new LoginCredentials({ * username: 'sample.user@signiant.com', * password: 'replace_with_real_password' * }); * const resourceFactory:MediaShuttleResourceFactory = new MediaShuttleResourceFactory(loginCredentials, {}); * ``` */ declare class MediaShuttleResourceFactory { private readonly _platformService; private readonly _transferClient; /** * @param credentials The credentials wrapper to allow for the creation and update of transfers. * Typically {@link LoginCredentials} would be used * @param sdkOptions See {@link SDKOptions} for more details. */ constructor(credentials: Credentials, options?: SDKOptions); /** * See the {@link Explorer} documentation on how to make calls to find the necessary input (portalId, files, serviceId, accountId) for * Download generation. * * @example * ``` * import { MediaShuttleResourceFactory, Download, DownloadOptions } from '@signiant/media-shuttle-sdk' * createDownload (resourceFactory: MediaShuttleResourceFactory, portalId: string, files: RemoteFile[], serviceId: string, accountId: string): Promise<Download> { * const downloadOptions: DownloadOptions = { * portalId, * files, * serviceId, * accountId, * } * return resourceFactory.generateDownload(downloadOptions); * } * ``` * * @param options The {@link PlatformDownloadOptions} to control how the {@link Download} will operate * @returns The {@link Download} transfer object. */ generateDownload(options: PlatformDownloadOptions): Promise<Download>; /** * See the {@link Explorer} documentation on how to make calls to find the necessary input (portalId, accountId and serviceId) for * Upload generation. * * @example * ``` * import { MediaShuttleResourceFactory, Upload, PlatformTransferOptions } from '@signiant/media-shuttle-sdk' * createUpload (resourceFactory: MediaShuttleResourceFactory, portalId: string, serviceId: string, accountId: string): Promise<Upload> { * const uploadOptions: PlatformTransferOptions = { * portalId, * serviceId, * accountId, * } * return resourceFactory.generateUpload(uploadOptions); * } * ``` * * @param options The {@link PlatformUploadOptions} to control how the {@link Upload} will operate * @returns The {@link Upload} transfer object. */ generateUpload(options: PlatformUploadOptions): Promise<Upload>; /** * @returns The {@link Explorer} instance */ getExplorer(): Explorer; } export default MediaShuttleResourceFactory; //# sourceMappingURL=MediaShuttleResourceFactory.d.ts.map