stack

Home > @infiniteobjects/models > StorageObject

StorageObject class

An Object on Google Storage

Signature:

export declare class StorageObject implements IStorageObject, IStorageObjectSchema 

Implements: IStorageObject, IStorageObjectSchema

Properties

Property Modifiers Type Description
bucket   string Bucket where this object is stored
debug static DebugInstance  
file   string Path to the file in the storage
fileName readonly string Filename on the storage
fileRef readonly File Reference to the object on the storage client
publicUrl   string | false Public Url of this object
storagePath readonly string Object URI on storage format

Methods

Method Modifiers Description
delete()   Removes an object from the storage
download(dest)   Downloads the Object to the given destination on the filesystem
exists()   Check if the object actually exist on the storage
fromPath(path) static Creates a new StorageObject from the given path
makePrivate()   Makes the object private (no public url)
makePublic()   Makes the object public to the internet
toFirestore()   Serializes to Schema
toJSON()   Serializes to API Responses
upload(localPath, bucket, bucketPath) static Uploads the given local file to the provided bucket