@tigrisdata/storage@3.16.0
Minor Changes
-
#168
4790e55Thanks @designcode! - Support theallowObjectAclandenableDirectoryListingoptions increateBucket.allowObjectAcl: trueapplies the object ACL setting via a follow-upupdateBucketcall once the bucket exists (the S3CreateBucketcommand can't carry it). If the bucket is created but the ACL update fails — whether it returns an error or throws — the returned error makes the partial state explicit.enableDirectoryListing: trueenables object listing for the bucket at creation time (relevant for public buckets). It defaults tofalse(listing disabled).
import { createBucket } from "@tigrisdata/storage"; await createBucket("my-bucket", { allowObjectAcl: true }); await createBucket("my-listable-bucket", { access: "public", enableDirectoryListing: true, });
-
#169
f6dade9Thanks @designcode! - AddrestoreObjectandgetRestoreInfofor working with archived objects.restoreObject(path, options?)restores an archived object (e.g. one in theGLACIERtier) back into an actively-readable copy for a number ofdays(defaults to1).getRestoreInfo(path, options?)reports an object's restore state from itsHEADheaders as aRestoreInfo({ status, expiresAt? }), using theRestoreStatusenum (Archived,InProgress,Restored). It resolves toundefinedwhen there is no restore information — for a non-archived object or one that does not exist.
import { restoreObject, getRestoreInfo, RestoreStatus, } from "@tigrisdata/storage"; await restoreObject("archived.bin", { days: 3 }); const { data } = await getRestoreInfo("archived.bin"); if (data?.status === RestoreStatus.InProgress) { // restore underway }