storage

Vercel Postgres, KV, Blob, and Edge Config

APACHE-2.0 License

Downloads
3.5M
Stars
453
Committers
27

Bot releases are visible (Hide)

storage - @vercel/[email protected] Latest Release

Published by github-actions[bot] 6 months ago

Patch Changes

  • 5b9b53d: Remove dependency pins in package.json.
storage - @vercel/[email protected]

Published by github-actions[bot] 7 months ago

Patch Changes

  • 13988ed: BREAKING CHANGE: The contentType field of the PutBlobResult is now optional which might break TS builds. This aligns the SDK typings with the actual Response of the Blob API.
storage - @vercel/[email protected]

Published by github-actions[bot] 7 months ago

Patch Changes

storage - @vercel/[email protected]

Published by github-actions[bot] 7 months ago

Minor Changes

  • e36fa70: feat(types): re-export pg-types for Drizzle
storage - @vercel/[email protected]

Published by github-actions[bot] 8 months ago

Minor Changes

  • 5fb6969: Make @opentelemetry/api optional and expose a setTracerProvider function
storage - @vercel/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

  • 69a5c52: fix(blob): correctly handle Node.js buffers as input
storage - @vercel/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

  • 78d5814: prevents having too many open connections
storage - @vercel/[email protected]

Published by github-actions[bot] 8 months ago

Patch Changes

  • 4e7e216: mark @opentelemetry/api as optional peer dependency
storage - @vercel/[email protected]

Published by github-actions[bot] 8 months ago

Major Changes

  • fcdc55e: - BREAKING CHANGE Return values are now read-only to improve in-memory caching

    It used to be possible to change the returned value as shown in this example:

    import { get } from '@vercel/edge-config';
    const countries = await get('allowedCountryCodes');
    countries.DE = true; // Will now cause TypeScript to error
    

    Moving forward, modifications like the above will cause a type error.

    If there is a need to modify the value, then the clone function can be used to clone the data and make it modifiable.

    import { get, clone } from '@vercel/edge-config';
    
    const myArray = await get('listOfAllowedIPs');
    const myArrayClone = clone(myArray); // Clones the data to make it modifiable
    myArrayClone.push('127.0.0.1'); // The `push` operation will work now
    
  • BREAKING CHANGE SDK now throws underlying errors

    Previous versions of the @vercel/edge-config package would catch most errors thrown by native functions and throw a generic network error instead - even if the underlying issue wasn't a network error. The new version will throw the original errors.

    Note applications which rely on the @vercel/edge-config: Unexpected error and @vercel/edge-config: Network error errors must adapt to the new implementation by ensuring other types of errors are handled as well.

  • The SDK now uses stale-while-revalidate semantics during development

    When @vercel/edge-config is used during development, with NODE_ENV being set to development, any read operation will fetch the entire Edge Config once and keep it in-memory to quickly resolve all other read operations for other keys, without waiting for the network. Subsequent reads will update the in-memory data in the background.

    This behaviour can be disabled by setting the environment variable EDGE_CONFIG_DISABLE_DEVELOPMENT_SWR to 1, or by using the disableDevelopmentCache option on the createClient function.

storage - @vercel/[email protected]

Published by github-actions[bot] 8 months ago

Minor Changes

  • 52c2fe2: feat(blob): add rate limited error
storage - @vercel/[email protected]

Published by github-actions[bot] 9 months ago

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
storage - @vercel/[email protected]

Published by github-actions[bot] 9 months ago

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.

storage - @vercel/[email protected]

Published by github-actions[bot] 9 months ago

Patch Changes

  • 5d84a4a: chore(deps): update dependency kysely to v0.27.2
  • Updated dependencies [5d84a4a]
storage - @vercel/[email protected]

Published by github-actions[bot] 9 months ago

Patch Changes

  • 5d84a4a: chore(deps): update dependency kysely to v0.27.2
storage - @vercel/[email protected]

Published by github-actions[bot] 9 months ago

Patch Changes

  • abfdf65: fix(deps): update dependency @neondatabase/serverless to v0.7.2
storage - @vercel/[email protected]

Published by github-actions[bot] 9 months ago

Patch Changes

  • abfdf65: fix(deps): update dependency @neondatabase/serverless to v0.7.2
  • Updated dependencies [abfdf65]
storage - @vercel/[email protected]

Published by github-actions[bot] 9 months ago

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

storage - @vercel/[email protected]

Published by github-actions[bot] 9 months ago

Minor Changes

  • f70264e: Correct VercelPostgresDialect to return an adapter that reports that transactions are not supported
storage - @vercel/[email protected]

Published by github-actions[bot] 9 months ago

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

storage - @vercel/[email protected]

Published by github-actions[bot] 9 months ago

Patch Changes

  • d4c06b0: chore(blob): fix types on client.put