Class Upload (5.0.1)

Inheritance

Pumpify > Upload

Package

gcs-resumable-upload

Constructors

(constructor)(cfg)

constructor(cfg: UploadConfig);

Constructs a new instance of the Upload class

Parameter
NameDescription
cfg UploadConfig

Properties

apiEndpoint

apiEndpoint: string;

authClient

authClient: {
        request: <T>(opts: GaxiosOptions) => Promise<GaxiosResponse<T>> | GaxiosPromise<T>;
    };

authConfig

authConfig?: {
        scopes?: string[];
    };

baseURI

baseURI: string;

bucket

bucket: string;

cacheKey

cacheKey: string;

chunkSize

chunkSize?: number;

configStore

configStore: ConfigStore;

contentLength

contentLength: number | '*';

customRequestOptions

customRequestOptions: GaxiosOptions;

encryption

encryption?: Encryption;

file

file: string;

generation

generation?: number;

key

key?: string | Buffer;

kmsKeyName

kmsKeyName?: string;

maxRetryDelay

maxRetryDelay: number;

maxRetryTotalTimeout

maxRetryTotalTimeout: number;

metadata

metadata: ConfigMetadata;

numBytesWritten

numBytesWritten: number;

numRetries

numRetries: number;

offset

offset?: number;

origin

origin?: string;

params

params: QueryParameters;

predefinedAcl

predefinedAcl?: PredefinedAcl;

private

private?: boolean;

public

public?: boolean;

retryableErrorFn

retryableErrorFn?: (err: ApiError) => boolean;

retryDelayMultiplier

retryDelayMultiplier: number;

retryLimit

retryLimit: number;

timeOfFirstRequest

timeOfFirstRequest: number;

uri

uri?: string;

uriProvidedManually

uriProvidedManually: boolean;

userProject

userProject?: string;

Methods

createURI()

createURI(): Promise<string>;
Returns
TypeDescription
Promise<string>

createURI(callback)

createURI(callback: CreateUriCallback): void;
Parameter
NameDescription
callback CreateUriCallback
Returns
TypeDescription
void

createURIAsync()

protected createURIAsync(): Promise<string>;
Returns
TypeDescription
Promise<string>

deleteConfig()

deleteConfig(): void;
Returns
TypeDescription
void

isServerErrorResponse(status)

isServerErrorResponse(status: number): boolean;

Check if a given status code is 5xx

Parameter
NameDescription
status number

The status code to check

Returns
TypeDescription
boolean

if the status is 5xx

isSuccessfulResponse(status)

isSuccessfulResponse(status: number): boolean;

Check if a given status code is 2xx

Parameter
NameDescription
status number

The status code to check

Returns
TypeDescription
boolean

if the status is 2xx

startUploading()

startUploading(): Promise<void>;
Returns
TypeDescription
Promise<void>