feat: Add OnCompleteCallback interceptor for HTTP call tracing#100
Merged
alexisandreason merged 2 commits intomasterfrom Mar 25, 2026
Merged
feat: Add OnCompleteCallback interceptor for HTTP call tracing#100alexisandreason merged 2 commits intomasterfrom
alexisandreason merged 2 commits intomasterfrom
Conversation
Made-with: Cursor
matthewtsmith
approved these changes
Mar 25, 2026
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
OnCompleteCallbackhook toFamisClientthat fires after every HTTP request (success or failure), providing structured call metadata including timing, method, URL, request/response bodies, and status codes. This enables callers (e.g. a tracing/logging service) to observe all SDK-level HTTP traffic without modifying internal SDK code.Changes
SdkCallInfointerface capturing method, URL, base URL, request headers/body, response status/body, duration, and optional error messageOnCompleteCallbacktype alias ((info: SdkCallInfo) => void)onCompleteoptional property toFamisClientonCompletethrough all three construction paths:withLoginCredential,withClientCredential, and the private constructor__startTimeon each outgoing request configSdkCallInfo, and fires the callback asynchronously (viaPromise.resolve().then(...)) to avoid blocking the response chainModified Files
Core Changes
famis_client.ts– AddedonCompletefield, wired it through all constructors, and registered axios interceptorsmodel/common.ts– AddedSdkCallInfointerface andOnCompleteCallbacktypeBreaking Changes
None —
onCompleteis optional and all existing call sites remain unchanged.Testing
FamisClientwith anonCompletecallback and verify it fires for each API callonCompleteis unaffectedAdditional Context
This callback is designed to integrate with the
facility360_r7trace service, which collects and stores HTTP call records for observability and debugging purposes.🤖 Generated with Claude Code
Made with Cursor