feat: add withLargeResponse runner wrapper - #9
Merged
Conversation
…ce README - Bump package version to 0.0.3-alpha.1. - Clarify comments in README regarding per-request options and runner structure. - Update TypeScript configuration to exclude test files. - Refactor types for better clarity and maintainability. - Improve tests for axios integration and runner behavior. - Ensure proper handling of undefined options in utility functions.
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.
Interceptors only run for requests that go through the axios adapter. Clients that register their own runner — how service-to-service lambda invokes are wired — bypass it, so responses over the payload limit fail with a
413. Hit intemplate-variables-api, where it surfaced as a generic 500.withLargeResponse(runner, options)wraps any runner with the same behaviour and options. It's typed structurally, so it isn't tied to Lambda or any transport and adds no dependency. The wrapped runner is spread rather than rebuilt —openapi-client-axioscallsrunner.runRequest(req, operation, runner.context)and the lambda runner reads its target function name off thatcontext, so dropping it breaks every request. There's a test pinning that.Two extras: the interceptor now shares the ref-detection helper, which makes its
content-typecheck tolerate; charset=utf-8and header casing (more permissive, pre-existing tests unmodified — shout if you'd rather split it out). README documents the new export and fixes therefPropertydefault, documented as$payloadRefwhere the code and middleware both use$payload_ref.33 tests (13 new), lint/typecheck/build clean. Verified on dev through
template-variables-api: 413 → 200 on an order with 100 hydrated reverse relations, e2e green.