mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 05:12:29 +00:00
- Introduced `requestPayer` option in S3-related functions and structures to handle Requester Pays buckets. - Updated S3 client methods to accept and propagate the `requestPayer` flag. - Enhanced documentation for the `requestPayer` option in the S3 type definitions. - Adjusted existing S3 operations to utilize the `requestPayer` parameter where applicable, ensuring compatibility with AWS S3's Requester Pays feature. - Ensured that the new functionality is integrated into multipart uploads and simple requests. ### What does this PR do? This change allows users to specify whether they are willing to pay for data transfer costs when accessing objects in Requester Pays buckets, improving flexibility and compliance with AWS S3's billing model. This closes #25499 ### How did you verify your code works? I have added a new test file to verify this functionality, and all my tests pass. I also tested this against an actual S3 bucket which can only be accessed if requester pays. I can confirm that it's accessible with `requestPayer` is `true`, and the default of `false` does not allow access. An example bucket is here: s3://hl-mainnet-evm-blocks/0/0/1.rmp.lz4 (my usecase is indexing [hyperliquid block data](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm/raw-hyperevm-block-data) which is stored in s3, and I want to use bun to index faster) --------- Co-authored-by: Alistair Smith <hi@alistair.sh> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
TypeScript types for Bun
These are the type definitions for Bun's JavaScript runtime APIs.
Installation
Install the @types/bun npm package:
# yarn/npm/pnpm work too
# @types/bun is an ordinary npm package
bun add -D @types/bun
That's it! VS Code and TypeScript automatically load @types/* packages into your project, so the Bun global and all bun:* modules should be available immediately.
Contributing
The @types/bun package is a shim that loads bun-types. The bun-types package lives in the Bun repo under packages/bun-types.
To add a new file, add it under packages/bun-types. Then add a triple-slash directive pointing to it inside ./index.d.ts.
+ /// <reference path="./newfile.d.ts" />
bun build
