Repository navigation
Conversation
…work errors - Add customFetch transport and exported types, binary rejection before signing, default Accept header, and README guidance (automation-tracker sieblyio#124) - Redact axios REST network errors with a narrow guard and whitelisted diagnostics while preserving HTTP errors (automation-tracker sieblyio#66) - Version 3.3.0
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional native fetch transport for REST (e.g. edge runtimes such as Cloudflare Workers) and redacts credentials from REST network errors. Default behaviour stays on axios.
Changelog
Optional native fetch transport: new customFetch REST client option (with exported CustomFetch, CustomFetchRequestInit and CustomFetchResponse types). When set, REST requests go through that fetch function (e.g. fetch or a Cloudflare Workers fetcher) instead of axios, with the same signing, URL/query serialisation, response handling and error shapes (HTTP 200 with code other than "00000" and HTTP 4xx/5xx errors match axios); errors thrown by the fetch function come back unchanged. Default stays axios. README section "Edge runtimes / native fetch (optional)" (automation-tracker #124)
customFetch mode rejects binary, multipart and stream request bodies (Buffer, Blob, FormData, ArrayBuffer/typed arrays, streams, including nested values) locally before signing; use the default axios transport for those inputs (automation-tracker #124)
customFetch mode sends Accept: application/json, text/plain, / (unless you set one), matching axios. README notes that runtime transport headers such as User-Agent and Accept-Encoding can differ between axios and fetch (automation-tracker #124)
REST network errors without a response (e.g. ECONNREFUSED, timeouts) now throw a sanitized Error (same message, code, name, plus whitelisted diagnostic requestOptions) instead of the raw axios error, so they no longer carry the API key, secret, passphrase or signature. Exchange error responses (e.g. code other than "00000") and other non-axios errors are rethrown unchanged (automation-tracker #66)
Version 3.3.0
Checks
npm run lint, npm run build: pass. tsc --noEmit -p tsconfig.json reports the same 10 errors in test/ws.util.ts as on master (no new errors)
Endpoint docs and llms.txt regenerated with the regex runner
Fixes automation-tracker: #124, #66