api
api copied to clipboard
feat: enhance ConfigOptions to include init parameter for fetch requests
| 🚥 Resolves #1046 |
|---|
🧰 Changes
This PR adds support for passing custom init options to the fetch request in the API core.
- The ConfigOptions interface now includes an optional init property, allowing users to specify additional RequestInit options.
- The APICore class now merges config.init into the fetch request's init object, ensuring user-supplied options are respected (except for signal, which is managed internally).
🧬 QA & Testing
- Set up an instance of APICore and pass custom init options (e.g., custom headers or credentials) via setConfig({ init: { ... } }).
- Make a request using fetch or fetchOperation.
- Verify that the custom init options are present in the outgoing request (except for signal).
- Ensure that the request still respects the internal timeout and abort logic.
- Run the existing test suite to confirm no regressions.