UNPKG

@uppy/companion

Version:

OAuth helper and remote fetcher for Uppy's (https://uppy.io) extensible file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Dropbox and Google Drive, S3 and more :dog:

35 lines (34 loc) 1.15 kB
/** * AuthError is error returned when an adapter encounters * an authorization error while communication with its corresponding provider * this signals to the client that the access token is invalid and needs to be * refreshed or the user needs to re-authenticate */ export class ProviderAuthError extends ProviderApiError { constructor(); } /** * ProviderApiError is error returned when an adapter encounters * an http error while communication with its corresponding provider */ export class ProviderApiError extends Error { /** * @param {string} message error message * @param {number} statusCode the http status code from the provider api */ constructor(message: string, statusCode: number); statusCode: number; isAuthError: boolean; } export class ProviderUserError extends ProviderApiError { /** * @param {object} json arbitrary JSON.stringify-able object that will be passed to the client */ constructor(json: object); json: any; } export function respondWithError(err: any, res: any): boolean; export function parseHttpError(err: any): { statusCode: any; body: any; };