Skip to content

@tigrisdata/storage@3.16.0

Choose a tag to compare

@github-actions github-actions released this 25 Jun 16:19
4dcc6f3

Minor Changes

  • #168 4790e55 Thanks @designcode! - Support the allowObjectAcl and enableDirectoryListing options in createBucket.

    • allowObjectAcl: true applies the object ACL setting via a follow-up updateBucket call once the bucket exists (the S3 CreateBucket command 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: true enables object listing for the bucket at creation time (relevant for public buckets). It defaults to false (listing disabled).
    import { createBucket } from "@tigrisdata/storage";
    
    await createBucket("my-bucket", { allowObjectAcl: true });
    await createBucket("my-listable-bucket", {
      access: "public",
      enableDirectoryListing: true,
    });
  • #169 f6dade9 Thanks @designcode! - Add restoreObject and getRestoreInfo for working with archived objects.

    • restoreObject(path, options?) restores an archived object (e.g. one in the GLACIER tier) back into an actively-readable copy for a number of days (defaults to 1).
    • getRestoreInfo(path, options?) reports an object's restore state from its HEAD headers as a RestoreInfo ({ status, expiresAt? }), using the RestoreStatus enum (Archived, InProgress, Restored). It resolves to undefined when 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
    }