Skip to content

Releases: vercel/storage

@vercel/[email protected]

12 Feb 13:25
ed0f9f2
Compare
Choose a tag to compare

Minor Changes

  • 52c2fe2: feat(blob): add rate limited error

@vercel/[email protected]

06 Feb 08:59
38bb593
Compare
Choose a tag to compare

Minor Changes

  • 8e278f2: # feat(blob): add advanced multipart upload methods

    This exposes the three different multipart steps as functions of the SDK. Before this change every multipart upload was uncontrolled, meaning the full data was passed to the SDK and the SDK took care of chunking and uploading.

    Now it's possible to manually upload chunks and start and complete the multipart upload. All of the new functions can be used both on the server and the browser. There are two different API's that can be used.

    All parts uploaded must be at least 5MB in size, except for the last part. The last part can be smaller than 5MB. If you have a single part, it can be any size. All parts must be the same size, except for the last part.

    Individual methods

    Use createMultipartUpload, uploadPart and completeMultipartUpload to manage the upload.

    const { key, uploadId } = await vercelBlob.createMultipartUpload(
      'big-file.txt',
      { access: 'public' },
    );
    
    const part1 = await vercelBlob.uploadPart(fullPath, 'first part', {
      access: 'public',
      key,
      uploadId,
      partNumber: 1,
    });
    
    const part2 = await vercelBlob.uploadPart(fullPath, 'second part', {
      access: 'public',
      key,
      uploadId,
      partNumber: 2,
    });
    
    const blob = await vercelBlob.completeMultipartUpload(
      fullPath,
      [part1, part2],
      {
        access: 'public',
        key,
        uploadId,
      },
    );

    Multipart uploader

    For multipart methods, since some of the data remains consistent (uploadId, key), you can make use of the createMultipartUploader. This function stores certain data internally, making it possible to offer convinient put and complete functions.

    const uploader = await vercelBlob.createMultipartUploader('big-file.txt', {
      access: 'public',
    });
    
    const part1 = await uploader.uploadPart(1, createReadStream(fullPath));
    
    const part2 = await uploader.uploadPart(2, createReadStream(fullPath));
    
    const blob = await uploader.complete([part1, part2]);

Patch Changes

  • 2ecc0e2: fix(blob): remove multipart boolean from copy options

@vercel/[email protected]

30 Jan 12:11
4aec804
Compare
Choose a tag to compare

Minor Changes

  • 5d71dda: # feat(blob): add downloadUrl and getDownloadUrl

    Adds a new blob property called downloadUrl. This URL will have the content-disposition set to attachment meaning it will force browsers to start a download instead of showing a preview. This URL can be used to implement download links. In addition to this new field the sdk is also exposing a new util function called getDownloadUrl which can also be used to derive a download URL from a blob URL.

@vercel/[email protected]

24 Jan 08:36
46ad264
Compare
Choose a tag to compare

Patch Changes

  • 5d84a4a: chore(deps): update dependency kysely to v0.27.2

@vercel/[email protected]

24 Jan 08:36
46ad264
Compare
Choose a tag to compare

Patch Changes

@vercel/[email protected]

23 Jan 08:50
02f97b6
Compare
Choose a tag to compare

Patch Changes

  • abfdf65: fix(deps): update dependency @neondatabase/serverless to v0.7.2

@vercel/[email protected]

23 Jan 08:50
02f97b6
Compare
Choose a tag to compare

Patch Changes

@vercel/[email protected]

18 Jan 17:23
c9c6123
Compare
Choose a tag to compare

Minor Changes

  • d44bd3b: feat(blob): add retry to all blob requests

    This change generalizes the way we request the internal Blob API. This moves api version, authorization, response validation and error handling all into one place.
    Also this adds a retry mechanism to the API requests

@vercel/[email protected]

16 Jan 14:05
3e677a5
Compare
Choose a tag to compare

Minor Changes

  • f70264e: Correct VercelPostgresDialect to return an adapter that reports that transactions are not supported

@vercel/[email protected]

15 Jan 16:12
816845b
Compare
Choose a tag to compare

Minor Changes

  • dc7ba0e: feat(blob): allow inline content disposition for certain blobs

    Once you use this new version, then most common medias won't be automatically
    downloading but rather will display the content inline.

    Already uploaded files will not change their behavior.
    You can reupload them if you want to change their behavior.

    Fixes #509