Package
gcs-resumable-upload!Properties
apiEndpoint
apiEndpoint?: string;
The API endpoint used for the request. Defaults to storage.googleapis.com
. **Warning**: If this value does not match the pattern *.googleapis.com, an emulator context will be assumed and authentication will be bypassed.
Type | Description |
string |
authClient
authClient?: {
request: <T = any>(opts: GaxiosOptions) => Promise<GaxiosResponse<T>> | GaxiosPromise<T>;
};
If you want to re-use an auth client from google-auto-auth, pass an instance here. Defaults to GoogleAuth and gets automatically overridden if an emulator context is detected.
Type | Description |
{ request: <T = any>(opts: GaxiosOptions) => Promise<GaxiosResponse<T>> | GaxiosPromise<T>; } |
authConfig
authConfig?: GoogleAuthOptions;
The GoogleAuthOptions passed to google-auth-library
Type | Description |
GoogleAuthOptions |
bucket
bucket: string;
The name of the destination bucket.
Type | Description |
string |
configPath
configPath?: string;
Where the gcs-resumable-upload configuration file should be stored on your system. This maps to the configstore option by the same name.
Type | Description |
string |
customRequestOptions
customRequestOptions?: GaxiosOptions;
For each API request we send, you may specify custom request options that we'll add onto the request. The request options follow the gaxios API: https://github.com/googleapis/gaxios#request-options.
Type | Description |
GaxiosOptions |
file
file: string;
The name of the destination file.
Type | Description |
string |
generation
generation?: number;
This will cause the upload to fail if the current generation of the remote object does not match the one provided here.
Type | Description |
number |
key
key?: string | Buffer;
A customer-supplied encryption key. See https://cloud.google.com/storage/docs/encryption#customer-supplied.
Type | Description |
string | Buffer |
kmsKeyName
kmsKeyName?: string;
Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key
, that will be used to encrypt the object. Overrides the object metadata's kms_key_name
value, if any.
Type | Description |
string |
metadata
metadata?: ConfigMetadata;
Any metadata you wish to set on the object.
Type | Description |
ConfigMetadata |
offset
offset?: number;
The starting byte of the upload stream, for resuming an interrupted upload. See https://cloud.google.com/storage/docs/json_api/v1/how-tos/resumable-upload#resume-upload.
Type | Description |
number |
origin
origin?: string;
Set an Origin header when creating the resumable upload URI.
Type | Description |
string |
params
params?: QueryParameters;
Specify query parameters that go along with the initial upload request. See https://cloud.google.com/storage/docs/json_api/v1/objects/insert#parameters
Type | Description |
QueryParameters |
predefinedAcl
predefinedAcl?: PredefinedAcl;
Apply a predefined set of access controls to the created file.
Type | Description |
PredefinedAcl |
private
private?: boolean;
Make the uploaded file private. (Alias for config.predefinedAcl = 'private')
Type | Description |
boolean |
public
public?: boolean;
Make the uploaded file public. (Alias for config.predefinedAcl = 'publicRead')
Type | Description |
boolean |
retryOptions
retryOptions?: RetryOptions;
Configuration options for retrying retriable errors.
Type | Description |
RetryOptions |
uri
uri?: string;
If you already have a resumable URI from a previously-created resumable upload, just pass it in here and we'll use that.
Type | Description |
string |
userProject
userProject?: string;
If the bucket being accessed has requesterPays functionality enabled, this can be set to control which project is billed for the access of this file.
Type | Description |
string |