ObjectStorage
ObjectStorage class for interacting with object storage services.
Param
The configuration for the object storage service.
Constructors
new ObjectStorage()
new ObjectStorage(config: ObjectStorageConfig): ObjectStorageParameters:
configObjectStorageConfig
Returns:
ObjectStorage
Methods
computeArchiveBasePath()
static computeArchiveBasePath(pathStr: string): stringCompute the base path for an archive. Returns normalized path without the root (drive letter or leading slash).
Parameters:
pathStrstring - The path to compute the base path for.
Returns:
string- The base path for the archive.
upload()
upload( path: string, organizationId: string,archiveBasePath?: string): Promise<string>Upload a file or directory to object storage.
Parameters:
pathstring - The path to the file or directory to upload.organizationIdstring - The organization ID to use for the upload.archiveBasePath?string - The base path to use for the archive.
Returns:
Promise<string>- The hash of the uploaded file or directory.
ObjectStorageConfig
Configuration for the ObjectStorage class.
Properties:
accessKeyIdstring - The access key ID for the object storage service.bucketName?string - The name of the bucket to use.endpointUrlstring - The endpoint URL for the object storage service.secretAccessKeystring - The secret access key for the object storage service.sessionToken?string - The session token for the object storage service. Used for temporary credentials.