Codec registry refactor#198
Merged
baelter merged 13 commits intomessage-codec-registryfrom May 6, 2026
Merged
Conversation
- Add createParserRegistry factory with typed ParserMap/Registry - Add ResolveBody<T, O> helper for content-type → body type cascade - Default K to never (no default contentType = PlainBody) - Make AMQPSessionOptions, AMQPSession, AMQPQueue generic on T/K - Add serializeBody with contentType constrained to parser keys - Update type-safety tests for ResolveBody and parser-aware queues - QueuePublishOptions now constrains contentType to registered parsers Known issues: downstream classes (Exchange, RPC) not yet threaded with T/K Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nSerializable Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds CoderMap/CoderRegistry types and a createCoderRegistry() factory parallel to createParserRegistry(), with optional built-in gzip/deflate coders via the useDefaults flag. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… path Extract logic from AMQPCodecRegistry into standalone exported functions that accept ParserRegistry/CoderRegistry objects directly. Returns a sync result when no coder is involved, or a Promise when encoding/decoding is needed. Also adds a standalone decodeMessage helper for use in Task 4. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use ParserMap/CoderMap base types for standalone function parameters instead of ParserRegistry<any>/CoderRegistry<any>. This eliminates all type casts at call sites and ~20 eslint-disable comments. ResolveBody now uses InferParserInput<P[O]> instead of structural match. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ence types Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace AMQPCodecRegistry/CodecMode with createCoderRegistry and P/C/KP/KC generics. Fix serializeBody call, unused properties params, q.publish leftover, and RPC handler return types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t config Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Method shorthand on AMQPParser gives bivariance, so AMQPParser<unknown, unknown> accepts narrower parsers. Inference helpers use unknown/never in the slot we discard so eslint no-explicit-any is satisfied without disable comments.
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.
No description provided.