UNPKG

node-test-bed-adapter

Version:

An adapter to connect a node.js application to the Test-bed's Common Information Space or Common Simulation Space.

37 lines (36 loc) 1.41 kB
import { ITestBedOptions } from '../index.mjs'; /** * Service to help the user upload large files to the Test-bed. * Files can be upload to the public folder, or obscure (semi-private). * If requested, a message can be sent to the Test-bed to inform others. */ export declare class LargeFileUploadService { private restUri?; private log; constructor(options: ITestBedOptions); /** Is the service enabled */ get enabled(): boolean; /** * Upload the file to the LargeFileService. * * @param file File path or an object containing a buffer and name to upload * @param isPrivate When true, the file will not show up in the public listing * @param cb Callback functions, invoked when the upload is done (or errors). */ upload(file: string | { buffer: Buffer; name: string; }, isPrivate?: boolean, cb?: (err?: Error, uploadUrl?: string) => void): void; /** Actually upload the file to the large-file-service */ private uploadFile; /** * Upload the buffer to the LargeFileService. * * @param file File to upload or an object containing a Buffer and name * @param isPrivate When true, the file will not show up in the public listing * @param cb Callback functions, invoked when the upload is done */ private uploadBuffer; /** Upload the form to the service */ private uploadForm; }